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.next());
		}

		int one = 10;
		int oneIdx = 0;
		int sum = 0;

		for (int i = 0; i < 5; i++) {
			if (dishes[i] % 10 != 0 && dishes[i] % 10 < one) {
				one = dishes[i] % 10;
				oneIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i == oneIdx) {
				sum += dishes[i];
			} else {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			}
		}

		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[] dishes = new int[5];

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

		int one = 10;
		int oneIdx = 0;
		int sum = 0;

		for (int i = 0; i < 5; i++) {
			if (dishes[i] % 10 != 0 && dishes[i] % 10 < one) {
				one = dishes[i] % 10;
				oneIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i == oneIdx) {
				sum += dishes[i];
			} else {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			}
		}

		System.out.println(sum);

	}
} 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.next());
		}

		int one = 10;
		int oneIdx = 0;
		int sum = 0;

		for (int i = 0; i < 5; i++) {
			if (dishes[i] % 10 != 0 && dishes[i] % 10 < one) {
				one = dishes[i] % 10;
				oneIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i == oneIdx) {
				sum += dishes[i];
			} else {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			}
		}

		System.out.println(sum);

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

		int[] dishes = new int[5];

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

		int one = 10;
		int oneIdx = 0;
		int sum = 0;

		for (int i = 0; i < 5; i++) {
			if (dishes[i] % 10 != 0 && dishes[i] % 10 < one) {
				one = dishes[i] % 10;
				oneIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i == oneIdx) {
				sum += dishes[i];
			} else {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			}
		}

		System.out.println(sum);

	} 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.next());
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			dishes[i] = Integer.parseInt(sc.next());
		} {
			dishes[i] = Integer.parseInt(sc.next());
		} dishes[i] = Integer.parseInt(sc.next()) dishes[i] dishes i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int one = 10; one 10 int oneIdx = 0; oneIdx 0 int sum = 0; sum 0 for (int i = 0; i < 5; i++) {
			if (dishes[i] % 10 != 0 && dishes[i] % 10 < one) {
				one = dishes[i] % 10;
				oneIdx = i;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if (dishes[i] % 10 != 0 && dishes[i] % 10 < one) {
				one = dishes[i] % 10;
				oneIdx = i;
			}
		} {
			if (dishes[i] % 10 != 0 && dishes[i] % 10 < one) {
				one = dishes[i] % 10;
				oneIdx = i;
			}
		} if (dishes[i] % 10 != 0 && dishes[i] % 10 < one) {
				one = dishes[i] % 10;
				oneIdx = i;
			} dishes[i] % 10 != 0 && dishes[i] % 10 < one dishes[i] % 10 != 0 dishes[i] % 10 dishes[i] dishes i 10 0 dishes[i] % 10 < one dishes[i] % 10 dishes[i] dishes i 10 one {
				one = dishes[i] % 10;
				oneIdx = i;
			} one = dishes[i] % 10 one dishes[i] % 10 dishes[i] dishes i 10 oneIdx = i oneIdx i for (int i = 0; i < 5; i++) {
			if (i == oneIdx) {
				sum += dishes[i];
			} else {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if (i == oneIdx) {
				sum += dishes[i];
			} else {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			}
		} {
			if (i == oneIdx) {
				sum += dishes[i];
			} else {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			}
		} if (i == oneIdx) {
				sum += dishes[i];
			} else {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			} i == oneIdx i oneIdx {
				sum += dishes[i];
			} sum += dishes[i] sum dishes[i] dishes i {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			} sum += Math.ceil(dishes[i] / 10.0) * 10 sum Math.ceil(dishes[i] / 10.0) * 10 Math.ceil(dishes[i] / 10.0) Math.ceil Math dishes[i] / 10.0 dishes[i] dishes i 10.0 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 sc = new Scanner(System.in);

		int[] dishes = new int[5];

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

		int one = 10;
		int oneIdx = 0;
		int sum = 0;

		for (int i = 0; i < 5; i++) {
			if (dishes[i] % 10 != 0 && dishes[i] % 10 < one) {
				one = dishes[i] % 10;
				oneIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i == oneIdx) {
				sum += dishes[i];
			} else {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			}
		}

		System.out.println(sum);

	}
} 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.next());
		}

		int one = 10;
		int oneIdx = 0;
		int sum = 0;

		for (int i = 0; i < 5; i++) {
			if (dishes[i] % 10 != 0 && dishes[i] % 10 < one) {
				one = dishes[i] % 10;
				oneIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i == oneIdx) {
				sum += dishes[i];
			} else {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			}
		}

		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[] dishes = new int[5];

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

		int one = 10;
		int oneIdx = 0;
		int sum = 0;

		for (int i = 0; i < 5; i++) {
			if (dishes[i] % 10 != 0 && dishes[i] % 10 < one) {
				one = dishes[i] % 10;
				oneIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i == oneIdx) {
				sum += dishes[i];
			} else {
				sum += Math.ceil(dishes[i] / 10.0) * 10;
			}
		}

		System.out.println(sum);

	}
}