import java.util.Scanner;

public class Main {
    public static void main(String... args) {
        // 入力
        Scanner sc = new Scanner(System.in);
        int[] x = new int[5];
        x[0] = sc.nextInt();
        x[1] = sc.nextInt();
        x[2] = sc.nextInt();
        x[3] = sc.nextInt();
        x[4] = sc.nextInt();
        int result = 0;

        int min = 9;
        int index = 0;
        for (int i = 0; i < 5; i++) {
            int temp = x[i] % 10;
            if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i == index) continue;
            if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10;
        }
        result += x[index];
        System.out.println(result);
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz