using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = new int[5];
            a[0] = int.Parse(Console.ReadLine());
            a[1] = int.Parse(Console.ReadLine());
            a[2] = int.Parse(Console.ReadLine());
            a[3] = int.Parse(Console.ReadLine());
            a[4] = int.Parse(Console.ReadLine());

            int totalMin = 0;
            for (int i = 0; i < a.Length -1; i++)
            {
                delta = (a[i]%10 == 0) ? (a[i]/10) * 10 : (a[i]/10 + 1) / 10;
                totalMin += (a[i]/10 + 1) * 10;
            }
            totalMin += a[a.Length-1];
            System.Console.WriteLine($"{totalMin}"); 
        }
    }
}
