import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner s = new Scanner(System.in)) {
			final int t[] = new int[] { s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt() };

			int ret = 0;
			int min = 10;
			for (int i = 0; i < t.length; i++) {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			}
			System.out.println(ret * 10 - (10 - min));
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		try (Scanner s = new Scanner(System.in)) {
			final int t[] = new int[] { s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt() };

			int ret = 0;
			int min = 10;
			for (int i = 0; i < t.length; i++) {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			}
			System.out.println(ret * 10 - (10 - min));
		}
	}
} Main public static void main(String[] args) {
		try (Scanner s = new Scanner(System.in)) {
			final int t[] = new int[] { s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt() };

			int ret = 0;
			int min = 10;
			for (int i = 0; i < t.length; i++) {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			}
			System.out.println(ret * 10 - (10 - min));
		}
	} main {
		try (Scanner s = new Scanner(System.in)) {
			final int t[] = new int[] { s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt() };

			int ret = 0;
			int min = 10;
			for (int i = 0; i < t.length; i++) {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			}
			System.out.println(ret * 10 - (10 - min));
		}
	} try (Scanner s = new Scanner(System.in)) {
			final int t[] = new int[] { s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt() };

			int ret = 0;
			int min = 10;
			for (int i = 0; i < t.length; i++) {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			}
			System.out.println(ret * 10 - (10 - min));
		} {
			final int t[] = new int[] { s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt() };

			int ret = 0;
			int min = 10;
			for (int i = 0; i < t.length; i++) {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			}
			System.out.println(ret * 10 - (10 - min));
		} Scanner s = new Scanner(System.in) Scanner s = new Scanner(System.in) new Scanner(System.in) final int t[] = new int[] { s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt() }; t new int[] { s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt() } int ret = 0; ret 0 int min = 10; min 10 for (int i = 0; i < t.length; i++) {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			} int i = 0; int i = 0; i 0 i < t.length i t.length t t.length i++ i++ i {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			} {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			} if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				} t[i] % 10 != 0 t[i] % 10 t[i] t i 10 0 {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} ret += (t[i] / 10) + 1 ret (t[i] / 10) + 1 (t[i] / 10) t[i] t i 10 1 min = Math.min(min, t[i] % 10) min Math.min(min, t[i] % 10) Math.min Math min t[i] % 10 t[i] t i 10 {
					ret += t[i] / 10;
				} ret += t[i] / 10 ret t[i] / 10 t[i] t i 10 System.out.println(ret * 10 - (10 - min)) System.out.println System.out System System.out ret * 10 - (10 - min) ret * 10 ret 10 (10 - min) 10 min String[] args args public class Main {
	public static void main(String[] args) {
		try (Scanner s = new Scanner(System.in)) {
			final int t[] = new int[] { s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt() };

			int ret = 0;
			int min = 10;
			for (int i = 0; i < t.length; i++) {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			}
			System.out.println(ret * 10 - (10 - min));
		}
	}
} public class Main {
	public static void main(String[] args) {
		try (Scanner s = new Scanner(System.in)) {
			final int t[] = new int[] { s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt() };

			int ret = 0;
			int min = 10;
			for (int i = 0; i < t.length; i++) {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			}
			System.out.println(ret * 10 - (10 - min));
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner s = new Scanner(System.in)) {
			final int t[] = new int[] { s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt() };

			int ret = 0;
			int min = 10;
			for (int i = 0; i < t.length; i++) {
				if (t[i] % 10 != 0) {
					ret += (t[i] / 10) + 1;
					min = Math.min(min, t[i] % 10);
				} else {
					ret += t[i] / 10;
				}
			}
			System.out.println(ret * 10 - (10 - min));
		}
	}
}
