
import java.util.Scanner;

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

		int[] orders = new int[5];

		for(int i = 0 ; i < orders.length; i++) {
			orders[i] = scanner.nextInt();
		}

		int last_order = 0;
		int devide_remainder = 10;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;
			if(num < devide_remainder && num != 0) {
				last_order = i;
				devide_remainder = num;
			}
		}

		int sum = 0;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;

			if(i == last_order || num == 0) {
				sum += orders[i];
			}else {
				sum += orders[i] / 10 * 10 + 10;
			}
		}

		System.out.println(sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int[] orders = new int[5];

		for(int i = 0 ; i < orders.length; i++) {
			orders[i] = scanner.nextInt();
		}

		int last_order = 0;
		int devide_remainder = 10;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;
			if(num < devide_remainder && num != 0) {
				last_order = i;
				devide_remainder = num;
			}
		}

		int sum = 0;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;

			if(i == last_order || num == 0) {
				sum += orders[i];
			}else {
				sum += orders[i] / 10 * 10 + 10;
			}
		}

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

		int[] orders = new int[5];

		for(int i = 0 ; i < orders.length; i++) {
			orders[i] = scanner.nextInt();
		}

		int last_order = 0;
		int devide_remainder = 10;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;
			if(num < devide_remainder && num != 0) {
				last_order = i;
				devide_remainder = num;
			}
		}

		int sum = 0;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;

			if(i == last_order || num == 0) {
				sum += orders[i];
			}else {
				sum += orders[i] / 10 * 10 + 10;
			}
		}

		System.out.println(sum);
	} main {
		Scanner scanner = new Scanner(System.in);

		int[] orders = new int[5];

		for(int i = 0 ; i < orders.length; i++) {
			orders[i] = scanner.nextInt();
		}

		int last_order = 0;
		int devide_remainder = 10;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;
			if(num < devide_remainder && num != 0) {
				last_order = i;
				devide_remainder = num;
			}
		}

		int sum = 0;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;

			if(i == last_order || num == 0) {
				sum += orders[i];
			}else {
				sum += orders[i] / 10 * 10 + 10;
			}
		}

		System.out.println(sum);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[] orders = new int[5]; orders new int[5] 5 for(int i = 0 ; i < orders.length; i++) {
			orders[i] = scanner.nextInt();
		} int i = 0 ; int i = 0 ; i 0 i < orders.length i orders.length orders orders.length i++ i++ i {
			orders[i] = scanner.nextInt();
		} {
			orders[i] = scanner.nextInt();
		} orders[i] = scanner.nextInt() orders[i] orders i scanner.nextInt() scanner.nextInt scanner int last_order = 0; last_order 0 int devide_remainder = 10; devide_remainder 10 for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;
			if(num < devide_remainder && num != 0) {
				last_order = i;
				devide_remainder = num;
			}
		} int i = 0; int i = 0; i 0 i < orders.length i orders.length orders orders.length i++ i++ i {
			int num = orders[i] % 10;
			if(num < devide_remainder && num != 0) {
				last_order = i;
				devide_remainder = num;
			}
		} {
			int num = orders[i] % 10;
			if(num < devide_remainder && num != 0) {
				last_order = i;
				devide_remainder = num;
			}
		} int num = orders[i] % 10; num orders[i] % 10 orders[i] orders i 10 if(num < devide_remainder && num != 0) {
				last_order = i;
				devide_remainder = num;
			} num < devide_remainder && num != 0 num < devide_remainder num devide_remainder num != 0 num 0 {
				last_order = i;
				devide_remainder = num;
			} last_order = i last_order i devide_remainder = num devide_remainder num int sum = 0; sum 0 for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;

			if(i == last_order || num == 0) {
				sum += orders[i];
			}else {
				sum += orders[i] / 10 * 10 + 10;
			}
		} int i = 0; int i = 0; i 0 i < orders.length i orders.length orders orders.length i++ i++ i {
			int num = orders[i] % 10;

			if(i == last_order || num == 0) {
				sum += orders[i];
			}else {
				sum += orders[i] / 10 * 10 + 10;
			}
		} {
			int num = orders[i] % 10;

			if(i == last_order || num == 0) {
				sum += orders[i];
			}else {
				sum += orders[i] / 10 * 10 + 10;
			}
		} int num = orders[i] % 10; num orders[i] % 10 orders[i] orders i 10 if(i == last_order || num == 0) {
				sum += orders[i];
			}else {
				sum += orders[i] / 10 * 10 + 10;
			} i == last_order || num == 0 i == last_order i last_order num == 0 num 0 {
				sum += orders[i];
			} sum += orders[i] sum orders[i] orders i {
				sum += orders[i] / 10 * 10 + 10;
			} sum += orders[i] / 10 * 10 + 10 sum orders[i] / 10 * 10 + 10 orders[i] / 10 * 10 orders[i] / 10 orders[i] orders i 10 10 10 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 scanner = new Scanner(System.in);

		int[] orders = new int[5];

		for(int i = 0 ; i < orders.length; i++) {
			orders[i] = scanner.nextInt();
		}

		int last_order = 0;
		int devide_remainder = 10;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;
			if(num < devide_remainder && num != 0) {
				last_order = i;
				devide_remainder = num;
			}
		}

		int sum = 0;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;

			if(i == last_order || num == 0) {
				sum += orders[i];
			}else {
				sum += orders[i] / 10 * 10 + 10;
			}
		}

		System.out.println(sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int[] orders = new int[5];

		for(int i = 0 ; i < orders.length; i++) {
			orders[i] = scanner.nextInt();
		}

		int last_order = 0;
		int devide_remainder = 10;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;
			if(num < devide_remainder && num != 0) {
				last_order = i;
				devide_remainder = num;
			}
		}

		int sum = 0;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;

			if(i == last_order || num == 0) {
				sum += orders[i];
			}else {
				sum += orders[i] / 10 * 10 + 10;
			}
		}

		System.out.println(sum);
	}
} Main

import java.util.Scanner;

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

		int[] orders = new int[5];

		for(int i = 0 ; i < orders.length; i++) {
			orders[i] = scanner.nextInt();
		}

		int last_order = 0;
		int devide_remainder = 10;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;
			if(num < devide_remainder && num != 0) {
				last_order = i;
				devide_remainder = num;
			}
		}

		int sum = 0;

		for(int i = 0; i < orders.length; i++) {
			int num = orders[i] % 10;

			if(i == last_order || num == 0) {
				sum += orders[i];
			}else {
				sum += orders[i] / 10 * 10 + 10;
			}
		}

		System.out.println(sum);
	}
}
