import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int dishes[] = new int[5];

		for(int i = 0; i < 5; i++) {
			 dishes[i] = Integer.parseInt(sc.nextLine());
		}

		int diffmax = 0;
		int diffmaxindex = 0;
		int diff = 0;
		for(int i = 0; i < 5; i++) {
			if(dishes[i]%10 != 0) {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			}

			if(diffmax < diff) {
				diffmax = diff;
				diffmaxindex = i;
			}
		}

		int sumTime = 0;

		for(int i = 0; i < 5; i++) {
			if(i != diffmaxindex) {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			}
		}

		sumTime = sumTime + dishes[diffmaxindex];

		System.out.println(sumTime);
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int dishes[] = new int[5];

		for(int i = 0; i < 5; i++) {
			 dishes[i] = Integer.parseInt(sc.nextLine());
		}

		int diffmax = 0;
		int diffmaxindex = 0;
		int diff = 0;
		for(int i = 0; i < 5; i++) {
			if(dishes[i]%10 != 0) {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			}

			if(diffmax < diff) {
				diffmax = diff;
				diffmaxindex = i;
			}
		}

		int sumTime = 0;

		for(int i = 0; i < 5; i++) {
			if(i != diffmaxindex) {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			}
		}

		sumTime = sumTime + dishes[diffmaxindex];

		System.out.println(sumTime);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int dishes[] = new int[5];

		for(int i = 0; i < 5; i++) {
			 dishes[i] = Integer.parseInt(sc.nextLine());
		}

		int diffmax = 0;
		int diffmaxindex = 0;
		int diff = 0;
		for(int i = 0; i < 5; i++) {
			if(dishes[i]%10 != 0) {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			}

			if(diffmax < diff) {
				diffmax = diff;
				diffmaxindex = i;
			}
		}

		int sumTime = 0;

		for(int i = 0; i < 5; i++) {
			if(i != diffmaxindex) {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			}
		}

		sumTime = sumTime + dishes[diffmaxindex];

		System.out.println(sumTime);
	} main {
		Scanner sc = new Scanner(System.in);

		int dishes[] = new int[5];

		for(int i = 0; i < 5; i++) {
			 dishes[i] = Integer.parseInt(sc.nextLine());
		}

		int diffmax = 0;
		int diffmaxindex = 0;
		int diff = 0;
		for(int i = 0; i < 5; i++) {
			if(dishes[i]%10 != 0) {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			}

			if(diffmax < diff) {
				diffmax = diff;
				diffmaxindex = i;
			}
		}

		int sumTime = 0;

		for(int i = 0; i < 5; i++) {
			if(i != diffmaxindex) {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			}
		}

		sumTime = sumTime + dishes[diffmaxindex];

		System.out.println(sumTime);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int dishes[] = new int[5]; dishes new int[5] 5 for(int i = 0; i < 5; i++) {
			 dishes[i] = Integer.parseInt(sc.nextLine());
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			 dishes[i] = Integer.parseInt(sc.nextLine());
		} {
			 dishes[i] = Integer.parseInt(sc.nextLine());
		} dishes[i] = Integer.parseInt(sc.nextLine()) dishes[i] dishes i Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc int diffmax = 0; diffmax 0 int diffmaxindex = 0; diffmaxindex 0 int diff = 0; diff 0 for(int i = 0; i < 5; i++) {
			if(dishes[i]%10 != 0) {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			}

			if(diffmax < diff) {
				diffmax = diff;
				diffmaxindex = i;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if(dishes[i]%10 != 0) {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			}

			if(diffmax < diff) {
				diffmax = diff;
				diffmaxindex = i;
			}
		} {
			if(dishes[i]%10 != 0) {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			}

			if(diffmax < diff) {
				diffmax = diff;
				diffmaxindex = i;
			}
		} if(dishes[i]%10 != 0) {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			} dishes[i]%10 != 0 dishes[i]%10 dishes[i] dishes i 10 0 {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			} diff = (dishes[i]/10 + 1) * 10 - dishes[i] diff (dishes[i]/10 + 1) * 10 - dishes[i] (dishes[i]/10 + 1) * 10 (dishes[i]/10 + 1) dishes[i]/10 dishes[i] dishes i 10 1 10 dishes[i] dishes i if(diffmax < diff) {
				diffmax = diff;
				diffmaxindex = i;
			} diffmax < diff diffmax diff {
				diffmax = diff;
				diffmaxindex = i;
			} diffmax = diff diffmax diff diffmaxindex = i diffmaxindex i int sumTime = 0; sumTime 0 for(int i = 0; i < 5; i++) {
			if(i != diffmaxindex) {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if(i != diffmaxindex) {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			}
		} {
			if(i != diffmaxindex) {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			}
		} if(i != diffmaxindex) {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			} i != diffmaxindex i diffmaxindex {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			} if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				} dishes[i]%10 != 0 dishes[i]%10 dishes[i] dishes i 10 0 {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				} sumTime = sumTime + ((dishes[i]/10 + 1) * 10) sumTime sumTime + ((dishes[i]/10 + 1) * 10) sumTime ((dishes[i]/10 + 1) * 10) (dishes[i]/10 + 1) dishes[i]/10 dishes[i] dishes i 10 1 10 {
					sumTime = sumTime + dishes[i];
				} sumTime = sumTime + dishes[i] sumTime sumTime + dishes[i] sumTime dishes[i] dishes i sumTime = sumTime + dishes[diffmaxindex] sumTime sumTime + dishes[diffmaxindex] sumTime dishes[diffmaxindex] dishes diffmaxindex System.out.println(sumTime) System.out.println System.out System System.out sumTime String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int dishes[] = new int[5];

		for(int i = 0; i < 5; i++) {
			 dishes[i] = Integer.parseInt(sc.nextLine());
		}

		int diffmax = 0;
		int diffmaxindex = 0;
		int diff = 0;
		for(int i = 0; i < 5; i++) {
			if(dishes[i]%10 != 0) {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			}

			if(diffmax < diff) {
				diffmax = diff;
				diffmaxindex = i;
			}
		}

		int sumTime = 0;

		for(int i = 0; i < 5; i++) {
			if(i != diffmaxindex) {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			}
		}

		sumTime = sumTime + dishes[diffmaxindex];

		System.out.println(sumTime);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int dishes[] = new int[5];

		for(int i = 0; i < 5; i++) {
			 dishes[i] = Integer.parseInt(sc.nextLine());
		}

		int diffmax = 0;
		int diffmaxindex = 0;
		int diff = 0;
		for(int i = 0; i < 5; i++) {
			if(dishes[i]%10 != 0) {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			}

			if(diffmax < diff) {
				diffmax = diff;
				diffmaxindex = i;
			}
		}

		int sumTime = 0;

		for(int i = 0; i < 5; i++) {
			if(i != diffmaxindex) {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			}
		}

		sumTime = sumTime + dishes[diffmaxindex];

		System.out.println(sumTime);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int dishes[] = new int[5];

		for(int i = 0; i < 5; i++) {
			 dishes[i] = Integer.parseInt(sc.nextLine());
		}

		int diffmax = 0;
		int diffmaxindex = 0;
		int diff = 0;
		for(int i = 0; i < 5; i++) {
			if(dishes[i]%10 != 0) {
				diff = (dishes[i]/10 + 1) * 10 - dishes[i];
			}

			if(diffmax < diff) {
				diffmax = diff;
				diffmaxindex = i;
			}
		}

		int sumTime = 0;

		for(int i = 0; i < 5; i++) {
			if(i != diffmaxindex) {
				if(dishes[i]%10 != 0) {
					sumTime = sumTime + ((dishes[i]/10 + 1) * 10);
				}else {
					sumTime = sumTime + dishes[i];
				}

			}
		}

		sumTime = sumTime + dishes[diffmaxindex];

		System.out.println(sumTime);
	}

}