package main

import (
	"fmt"
	"math"
	"sort"
)

func main() {
	var a, b, c, d, e int
	fmt.Scan(&a, &b, &c, &d, &e)
	arr := []int{a, b, c, d, e}
	sort.Sort(sort.IntSlice(arr))
	sum := 0
	min := math.MaxInt32
	for _, i := range arr {
		if i % 10 != 0 {
			if min > i % 10 {
				min = i % 10
			}
		}
		tmp := math.Ceil(float64(i) * 0.1)
		sum += int(tmp) * 10
	}
	fmt.Println(sum - (10 - min))
}