import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d,sum = 0,max =0;
		for(int i = 0; i < 5; i++) {
			d = sc.nextInt();
			int t = 0;
			t += Math.ceil((double)d/ 10) * 10;
			sum += t;
			if(max < t - d) {
				max = t-d;
			}
		}
		System.out.println(sum - max);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d,sum = 0,max =0;
		for(int i = 0; i < 5; i++) {
			d = sc.nextInt();
			int t = 0;
			t += Math.ceil((double)d/ 10) * 10;
			sum += t;
			if(max < t - d) {
				max = t-d;
			}
		}
		System.out.println(sum - max);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d,sum = 0,max =0;
		for(int i = 0; i < 5; i++) {
			d = sc.nextInt();
			int t = 0;
			t += Math.ceil((double)d/ 10) * 10;
			sum += t;
			if(max < t - d) {
				max = t-d;
			}
		}
		System.out.println(sum - max);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int d,sum = 0,max =0;
		for(int i = 0; i < 5; i++) {
			d = sc.nextInt();
			int t = 0;
			t += Math.ceil((double)d/ 10) * 10;
			sum += t;
			if(max < t - d) {
				max = t-d;
			}
		}
		System.out.println(sum - max);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int d d sum = 0 sum 0 max =0; max 0 for(int i = 0; i < 5; i++) {
			d = sc.nextInt();
			int t = 0;
			t += Math.ceil((double)d/ 10) * 10;
			sum += t;
			if(max < t - d) {
				max = t-d;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			d = sc.nextInt();
			int t = 0;
			t += Math.ceil((double)d/ 10) * 10;
			sum += t;
			if(max < t - d) {
				max = t-d;
			}
		} {
			d = sc.nextInt();
			int t = 0;
			t += Math.ceil((double)d/ 10) * 10;
			sum += t;
			if(max < t - d) {
				max = t-d;
			}
		} d = sc.nextInt() d sc.nextInt() sc.nextInt sc int t = 0; t 0 t += Math.ceil((double)d/ 10) * 10 t Math.ceil((double)d/ 10) * 10 Math.ceil((double)d/ 10) Math.ceil Math (double)d/ 10 (double)d 10 10 sum += t sum t if(max < t - d) {
				max = t-d;
			} max < t - d max t - d t d {
				max = t-d;
			} max = t-d max t-d t d System.out.println(sum - max) System.out.println System.out System System.out sum - max sum max sc.close() sc.close sc String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d,sum = 0,max =0;
		for(int i = 0; i < 5; i++) {
			d = sc.nextInt();
			int t = 0;
			t += Math.ceil((double)d/ 10) * 10;
			sum += t;
			if(max < t - d) {
				max = t-d;
			}
		}
		System.out.println(sum - max);
		sc.close();
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d,sum = 0,max =0;
		for(int i = 0; i < 5; i++) {
			d = sc.nextInt();
			int t = 0;
			t += Math.ceil((double)d/ 10) * 10;
			sum += t;
			if(max < t - d) {
				max = t-d;
			}
		}
		System.out.println(sum - max);
		sc.close();
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d,sum = 0,max =0;
		for(int i = 0; i < 5; i++) {
			d = sc.nextInt();
			int t = 0;
			t += Math.ceil((double)d/ 10) * 10;
			sum += t;
			if(max < t - d) {
				max = t-d;
			}
		}
		System.out.println(sum - max);
		sc.close();
	}
}