import java.util.*;

public class Main{
	public static void main(String[] args) throws Exception {
		Scanner s = new Scanner(System.in);
		int N = 5, sum = 0, n = 10;
		int[] t = new int [N];
		for (int i = 0; i < N; i++){
			t[i] = s.nextInt();
			int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10};
			// System.out.println(T[0] + " " + T[1]);
			sum += T[0];
			// System.out.println(sum);
			if (T[1] < n && T[1] != 0) n = T[1];
			// System.out.println(n);
			// System.out.println();
		}
		System.out.println(sum * 10 + n - 10);
		/*
		29 20 7 35 120 ->215
		101 86 119 108 57 -> 481
		*/
		
	}
}

/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