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

class Program {
  static void Main() {
    var d = new List<int>();
    int A(int x) => (x + 9) / 10 * 10;
    int B(int x) => A(x) - x;
    var s = "";
    while ((s = Console.ReadLine()) != null) d.Add(int.Parse(s));
    Console.WriteLine(d.Select(A).Sum() - d.Select(B).Max());
  }
}