
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] N =new int[5];
		int[] add =new int[5];
		int minmod = 10;
		int mini = 0;

		long sum=0;

		for (int i = 0; i < 5; i++) {
			N[i] =sc.nextInt();
			add[i] = N[i] % 10;
			if (add[i] != 0) {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			}
		}
		if (minmod < 10) {
			for (int i = 0; i < 5; i++) {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			}
			sum+=N[mini];
		} else {
			for (int i : N) {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			}
		}

		System.out.println(sum);


	}
}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] N =new int[5];
		int[] add =new int[5];
		int minmod = 10;
		int mini = 0;

		long sum=0;

		for (int i = 0; i < 5; i++) {
			N[i] =sc.nextInt();
			add[i] = N[i] % 10;
			if (add[i] != 0) {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			}
		}
		if (minmod < 10) {
			for (int i = 0; i < 5; i++) {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			}
			sum+=N[mini];
		} else {
			for (int i : N) {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			}
		}

		System.out.println(sum);


	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] N =new int[5];
		int[] add =new int[5];
		int minmod = 10;
		int mini = 0;

		long sum=0;

		for (int i = 0; i < 5; i++) {
			N[i] =sc.nextInt();
			add[i] = N[i] % 10;
			if (add[i] != 0) {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			}
		}
		if (minmod < 10) {
			for (int i = 0; i < 5; i++) {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			}
			sum+=N[mini];
		} else {
			for (int i : N) {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			}
		}

		System.out.println(sum);


	} main {
		Scanner sc = new Scanner(System.in);
		int[] N =new int[5];
		int[] add =new int[5];
		int minmod = 10;
		int mini = 0;

		long sum=0;

		for (int i = 0; i < 5; i++) {
			N[i] =sc.nextInt();
			add[i] = N[i] % 10;
			if (add[i] != 0) {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			}
		}
		if (minmod < 10) {
			for (int i = 0; i < 5; i++) {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			}
			sum+=N[mini];
		} else {
			for (int i : N) {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			}
		}

		System.out.println(sum);


	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] N =new int[5]; N new int[5] 5 int[] add =new int[5]; add new int[5] 5 int minmod = 10; minmod 10 int mini = 0; mini 0 long sum=0; sum 0 for (int i = 0; i < 5; i++) {
			N[i] =sc.nextInt();
			add[i] = N[i] % 10;
			if (add[i] != 0) {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			N[i] =sc.nextInt();
			add[i] = N[i] % 10;
			if (add[i] != 0) {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			}
		} {
			N[i] =sc.nextInt();
			add[i] = N[i] % 10;
			if (add[i] != 0) {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			}
		} N[i] =sc.nextInt() N[i] N i sc.nextInt() sc.nextInt sc add[i] = N[i] % 10 add[i] add i N[i] % 10 N[i] N i 10 if (add[i] != 0) {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			} add[i] != 0 add[i] add i 0 {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			} if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				} Math.min(minmod, add[i]) == add[i] Math.min(minmod, add[i]) Math.min Math minmod add[i] add i add[i] add i {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				} minmod = Math.min(minmod, add[i]) minmod Math.min(minmod, add[i]) Math.min Math minmod add[i] add i mini = i mini i if (minmod < 10) {
			for (int i = 0; i < 5; i++) {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			}
			sum+=N[mini];
		} else {
			for (int i : N) {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			}
		} minmod < 10 minmod 10 {
			for (int i = 0; i < 5; i++) {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			}
			sum+=N[mini];
		} for (int i = 0; i < 5; i++) {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			} {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			} if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				} i == mini i mini {
					continue;
				} continue; {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				} int let = N[i]; let N[i] N i if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					} let % 10 !=0 let % 10 let 10 0 {
						let =(let/10 + 1)*10;
					} let =(let/10 + 1)*10 let (let/10 + 1)*10 (let/10 + 1) let/10 let 10 1 10 sum+=let sum let sum+=N[mini] sum N[mini] N mini {
			for (int i : N) {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			}
		} for (int i : N) {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			} int i N {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			} {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			} if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				} i % 10 !=0 i % 10 i 10 0 {
					i =(i/10 + 1)*10;
				} i =(i/10 + 1)*10 i (i/10 + 1)*10 (i/10 + 1) i/10 i 10 1 10 sum+=i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] N =new int[5];
		int[] add =new int[5];
		int minmod = 10;
		int mini = 0;

		long sum=0;

		for (int i = 0; i < 5; i++) {
			N[i] =sc.nextInt();
			add[i] = N[i] % 10;
			if (add[i] != 0) {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			}
		}
		if (minmod < 10) {
			for (int i = 0; i < 5; i++) {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			}
			sum+=N[mini];
		} else {
			for (int i : N) {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			}
		}

		System.out.println(sum);


	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] N =new int[5];
		int[] add =new int[5];
		int minmod = 10;
		int mini = 0;

		long sum=0;

		for (int i = 0; i < 5; i++) {
			N[i] =sc.nextInt();
			add[i] = N[i] % 10;
			if (add[i] != 0) {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			}
		}
		if (minmod < 10) {
			for (int i = 0; i < 5; i++) {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			}
			sum+=N[mini];
		} else {
			for (int i : N) {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			}
		}

		System.out.println(sum);


	}
} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] N =new int[5];
		int[] add =new int[5];
		int minmod = 10;
		int mini = 0;

		long sum=0;

		for (int i = 0; i < 5; i++) {
			N[i] =sc.nextInt();
			add[i] = N[i] % 10;
			if (add[i] != 0) {
				if (Math.min(minmod, add[i]) == add[i]) {
					minmod = Math.min(minmod, add[i]);
					mini = i;
				}
			}
		}
		if (minmod < 10) {
			for (int i = 0; i < 5; i++) {
				if (i == mini) {
					continue;
				}else {
					int let = N[i];
					if (let % 10 !=0) {
						let =(let/10 + 1)*10;
					}
					sum+=let;
				}
			}
			sum+=N[mini];
		} else {
			for (int i : N) {
				if (i % 10 !=0) {
					i =(i/10 + 1)*10;
				}
				sum+=i;
			}
		}

		System.out.println(sum);


	}
}


