import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] input = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input[i] = sc.nextInt();
		}


		int[] input2 = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input2[i] = input[i] % 10;
		}

		int minNo = -1;
		int min = 10;
		for(int i = 0; i < input.length ; i++) {
			if(input2[i] < min && input2[i] != 0) {
				min = input2[i];
				minNo = i;
			}
		}

		int answer = 0;
		for(int i = 0; i < input.length ; i++) {
			if(i != minNo && input2[i] != 0) {
				input[i] = ((int)(input[i]/10) + 1)*10;
			}
			answer += input[i];
		}

		System.out.println(answer);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] input = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input[i] = sc.nextInt();
		}


		int[] input2 = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input2[i] = input[i] % 10;
		}

		int minNo = -1;
		int min = 10;
		for(int i = 0; i < input.length ; i++) {
			if(input2[i] < min && input2[i] != 0) {
				min = input2[i];
				minNo = i;
			}
		}

		int answer = 0;
		for(int i = 0; i < input.length ; i++) {
			if(i != minNo && input2[i] != 0) {
				input[i] = ((int)(input[i]/10) + 1)*10;
			}
			answer += input[i];
		}

		System.out.println(answer);
	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] input = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input[i] = sc.nextInt();
		}


		int[] input2 = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input2[i] = input[i] % 10;
		}

		int minNo = -1;
		int min = 10;
		for(int i = 0; i < input.length ; i++) {
			if(input2[i] < min && input2[i] != 0) {
				min = input2[i];
				minNo = i;
			}
		}

		int answer = 0;
		for(int i = 0; i < input.length ; i++) {
			if(i != minNo && input2[i] != 0) {
				input[i] = ((int)(input[i]/10) + 1)*10;
			}
			answer += input[i];
		}

		System.out.println(answer);
	} main {

		Scanner sc = new Scanner(System.in);

		int[] input = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input[i] = sc.nextInt();
		}


		int[] input2 = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input2[i] = input[i] % 10;
		}

		int minNo = -1;
		int min = 10;
		for(int i = 0; i < input.length ; i++) {
			if(input2[i] < min && input2[i] != 0) {
				min = input2[i];
				minNo = i;
			}
		}

		int answer = 0;
		for(int i = 0; i < input.length ; i++) {
			if(i != minNo && input2[i] != 0) {
				input[i] = ((int)(input[i]/10) + 1)*10;
			}
			answer += input[i];
		}

		System.out.println(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] input = new int[5]; input new int[5] 5 for(int i = 0; i < input.length ; i++) {
			input[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < input.length i input.length input input.length i++ i++ i {
			input[i] = sc.nextInt();
		} {
			input[i] = sc.nextInt();
		} input[i] = sc.nextInt() input[i] input i sc.nextInt() sc.nextInt sc int[] input2 = new int[5]; input2 new int[5] 5 for(int i = 0; i < input.length ; i++) {
			input2[i] = input[i] % 10;
		} int i = 0; int i = 0; i 0 i < input.length i input.length input input.length i++ i++ i {
			input2[i] = input[i] % 10;
		} {
			input2[i] = input[i] % 10;
		} input2[i] = input[i] % 10 input2[i] input2 i input[i] % 10 input[i] input i 10 int minNo = -1; minNo -1 1 int min = 10; min 10 for(int i = 0; i < input.length ; i++) {
			if(input2[i] < min && input2[i] != 0) {
				min = input2[i];
				minNo = i;
			}
		} int i = 0; int i = 0; i 0 i < input.length i input.length input input.length i++ i++ i {
			if(input2[i] < min && input2[i] != 0) {
				min = input2[i];
				minNo = i;
			}
		} {
			if(input2[i] < min && input2[i] != 0) {
				min = input2[i];
				minNo = i;
			}
		} if(input2[i] < min && input2[i] != 0) {
				min = input2[i];
				minNo = i;
			} input2[i] < min && input2[i] != 0 input2[i] < min input2[i] input2 i min input2[i] != 0 input2[i] input2 i 0 {
				min = input2[i];
				minNo = i;
			} min = input2[i] min input2[i] input2 i minNo = i minNo i int answer = 0; answer 0 for(int i = 0; i < input.length ; i++) {
			if(i != minNo && input2[i] != 0) {
				input[i] = ((int)(input[i]/10) + 1)*10;
			}
			answer += input[i];
		} int i = 0; int i = 0; i 0 i < input.length i input.length input input.length i++ i++ i {
			if(i != minNo && input2[i] != 0) {
				input[i] = ((int)(input[i]/10) + 1)*10;
			}
			answer += input[i];
		} {
			if(i != minNo && input2[i] != 0) {
				input[i] = ((int)(input[i]/10) + 1)*10;
			}
			answer += input[i];
		} if(i != minNo && input2[i] != 0) {
				input[i] = ((int)(input[i]/10) + 1)*10;
			} i != minNo && input2[i] != 0 i != minNo i minNo input2[i] != 0 input2[i] input2 i 0 {
				input[i] = ((int)(input[i]/10) + 1)*10;
			} input[i] = ((int)(input[i]/10) + 1)*10 input[i] input i ((int)(input[i]/10) + 1)*10 ((int)(input[i]/10) + 1) (int)(input[i]/10) input[i] input i 10 1 10 answer += input[i] answer input[i] input i System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] input = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input[i] = sc.nextInt();
		}


		int[] input2 = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input2[i] = input[i] % 10;
		}

		int minNo = -1;
		int min = 10;
		for(int i = 0; i < input.length ; i++) {
			if(input2[i] < min && input2[i] != 0) {
				min = input2[i];
				minNo = i;
			}
		}

		int answer = 0;
		for(int i = 0; i < input.length ; i++) {
			if(i != minNo && input2[i] != 0) {
				input[i] = ((int)(input[i]/10) + 1)*10;
			}
			answer += input[i];
		}

		System.out.println(answer);
	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] input = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input[i] = sc.nextInt();
		}


		int[] input2 = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input2[i] = input[i] % 10;
		}

		int minNo = -1;
		int min = 10;
		for(int i = 0; i < input.length ; i++) {
			if(input2[i] < min && input2[i] != 0) {
				min = input2[i];
				minNo = i;
			}
		}

		int answer = 0;
		for(int i = 0; i < input.length ; i++) {
			if(i != minNo && input2[i] != 0) {
				input[i] = ((int)(input[i]/10) + 1)*10;
			}
			answer += input[i];
		}

		System.out.println(answer);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] input = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input[i] = sc.nextInt();
		}


		int[] input2 = new int[5];
		for(int i = 0; i < input.length ; i++) {
			input2[i] = input[i] % 10;
		}

		int minNo = -1;
		int min = 10;
		for(int i = 0; i < input.length ; i++) {
			if(input2[i] < min && input2[i] != 0) {
				min = input2[i];
				minNo = i;
			}
		}

		int answer = 0;
		for(int i = 0; i < input.length ; i++) {
			if(i != minNo && input2[i] != 0) {
				input[i] = ((int)(input[i]/10) + 1)*10;
			}
			answer += input[i];
		}

		System.out.println(answer);
	}

}