import java.util.Scanner;

public class Main {

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

		int[] a = new int[5];
		int[] b = new int[5];
		int[] c = new int[5];
		int d = 0;
		int min = 9;
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < a.length; i++) {
			if (a[i] % 10 == 0) {
				b[i] = a[i];
				c[i] = 1;

			} else {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			}
		}

		b[d] = a[d];

		int sum = 0;
		for (int i = 0; i < b.length; i++) {
			sum += b[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[] a = new int[5];
		int[] b = new int[5];
		int[] c = new int[5];
		int d = 0;
		int min = 9;
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < a.length; i++) {
			if (a[i] % 10 == 0) {
				b[i] = a[i];
				c[i] = 1;

			} else {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			}
		}

		b[d] = a[d];

		int sum = 0;
		for (int i = 0; i < b.length; i++) {
			sum += b[i];
		}
		System.out.println(sum);
	}

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

		int[] a = new int[5];
		int[] b = new int[5];
		int[] c = new int[5];
		int d = 0;
		int min = 9;
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < a.length; i++) {
			if (a[i] % 10 == 0) {
				b[i] = a[i];
				c[i] = 1;

			} else {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			}
		}

		b[d] = a[d];

		int sum = 0;
		for (int i = 0; i < b.length; i++) {
			sum += b[i];
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);

		int[] a = new int[5];
		int[] b = new int[5];
		int[] c = new int[5];
		int d = 0;
		int min = 9;
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < a.length; i++) {
			if (a[i] % 10 == 0) {
				b[i] = a[i];
				c[i] = 1;

			} else {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			}
		}

		b[d] = a[d];

		int sum = 0;
		for (int i = 0; i < b.length; i++) {
			sum += b[i];
		}
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[5]; a new int[5] 5 int[] b = new int[5]; b new int[5] 5 int[] c = new int[5]; c new int[5] 5 int d = 0; d 0 int min = 9; min 9 for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
			a[i] = sc.nextInt();
		} {
			a[i] = sc.nextInt();
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc for (int i = 0; i < a.length; i++) {
			if (a[i] % 10 == 0) {
				b[i] = a[i];
				c[i] = 1;

			} else {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			}
		} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
			if (a[i] % 10 == 0) {
				b[i] = a[i];
				c[i] = 1;

			} else {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			}
		} {
			if (a[i] % 10 == 0) {
				b[i] = a[i];
				c[i] = 1;

			} else {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			}
		} if (a[i] % 10 == 0) {
				b[i] = a[i];
				c[i] = 1;

			} else {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			} a[i] % 10 == 0 a[i] % 10 a[i] a i 10 0 {
				b[i] = a[i];
				c[i] = 1;

			} b[i] = a[i] b[i] b i a[i] a i c[i] = 1 c[i] c i 1 {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			} int temp = a[i] / 10; temp a[i] / 10 a[i] a i 10 b[i] = temp * 10 + 10 b[i] b i temp * 10 + 10 temp * 10 temp 10 10 String str = String.valueOf(a[i]); str String.valueOf(a[i]) String.valueOf String a[i] a i String check = str.substring(str.length() - 1); check str.substring(str.length() - 1) str.substring str str.length() - 1 str.length() str.length str 1 if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				} min > Integer.parseInt(check) min Integer.parseInt(check) Integer.parseInt Integer check {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				} min = Math.min(min, Integer.parseInt(check)) min Math.min(min, Integer.parseInt(check)) Math.min Math min Integer.parseInt(check) Integer.parseInt Integer check d = i d i b[d] = a[d] b[d] b d a[d] a d int sum = 0; sum 0 for (int i = 0; i < b.length; i++) {
			sum += b[i];
		} int i = 0; int i = 0; i 0 i < b.length i b.length b b.length i++ i++ i {
			sum += b[i];
		} {
			sum += b[i];
		} sum += b[i] sum b[i] b 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[] a = new int[5];
		int[] b = new int[5];
		int[] c = new int[5];
		int d = 0;
		int min = 9;
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < a.length; i++) {
			if (a[i] % 10 == 0) {
				b[i] = a[i];
				c[i] = 1;

			} else {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			}
		}

		b[d] = a[d];

		int sum = 0;
		for (int i = 0; i < b.length; i++) {
			sum += b[i];
		}
		System.out.println(sum);
	}

} public class Main {

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

		int[] a = new int[5];
		int[] b = new int[5];
		int[] c = new int[5];
		int d = 0;
		int min = 9;
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < a.length; i++) {
			if (a[i] % 10 == 0) {
				b[i] = a[i];
				c[i] = 1;

			} else {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			}
		}

		b[d] = a[d];

		int sum = 0;
		for (int i = 0; i < b.length; i++) {
			sum += b[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[] a = new int[5];
		int[] b = new int[5];
		int[] c = new int[5];
		int d = 0;
		int min = 9;
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < a.length; i++) {
			if (a[i] % 10 == 0) {
				b[i] = a[i];
				c[i] = 1;

			} else {
				int temp = a[i] / 10;
				b[i] = temp * 10 + 10;
				String str = String.valueOf(a[i]);
				String check = str.substring(str.length() - 1);
				if (min > Integer.parseInt(check)) {
					min = Math.min(min, Integer.parseInt(check));
					d = i;
				}
			}
		}

		b[d] = a[d];

		int sum = 0;
		for (int i = 0; i < b.length; i++) {
			sum += b[i];
		}
		System.out.println(sum);
	}

}
