import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int[][] a = new int[5][2];
		int max = 0, sum = 0;
		for (int i = 0; i < 5; i++) {
			a[i][0] = sc.nextInt();
			if (a[i][0] % 10 == 0) {
				a[i][1] = a[i][0];
			} else {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			}
			max = Math.max(max, a[i][1] - a[i][0]);
			sum += a[i][1];
		}
		sum = sum - max;
		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);
		StringBuilder sb = new StringBuilder();
		int[][] a = new int[5][2];
		int max = 0, sum = 0;
		for (int i = 0; i < 5; i++) {
			a[i][0] = sc.nextInt();
			if (a[i][0] % 10 == 0) {
				a[i][1] = a[i][0];
			} else {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			}
			max = Math.max(max, a[i][1] - a[i][0]);
			sum += a[i][1];
		}
		sum = sum - max;
		System.out.println(sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int[][] a = new int[5][2];
		int max = 0, sum = 0;
		for (int i = 0; i < 5; i++) {
			a[i][0] = sc.nextInt();
			if (a[i][0] % 10 == 0) {
				a[i][1] = a[i][0];
			} else {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			}
			max = Math.max(max, a[i][1] - a[i][0]);
			sum += a[i][1];
		}
		sum = sum - max;
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int[][] a = new int[5][2];
		int max = 0, sum = 0;
		for (int i = 0; i < 5; i++) {
			a[i][0] = sc.nextInt();
			if (a[i][0] % 10 == 0) {
				a[i][1] = a[i][0];
			} else {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			}
			max = Math.max(max, a[i][1] - a[i][0]);
			sum += a[i][1];
		}
		sum = sum - max;
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int[][] a = new int[5][2]; a new int[5][2] 5 2 int max = 0 max 0 sum = 0; sum 0 for (int i = 0; i < 5; i++) {
			a[i][0] = sc.nextInt();
			if (a[i][0] % 10 == 0) {
				a[i][1] = a[i][0];
			} else {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			}
			max = Math.max(max, a[i][1] - a[i][0]);
			sum += a[i][1];
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			a[i][0] = sc.nextInt();
			if (a[i][0] % 10 == 0) {
				a[i][1] = a[i][0];
			} else {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			}
			max = Math.max(max, a[i][1] - a[i][0]);
			sum += a[i][1];
		} {
			a[i][0] = sc.nextInt();
			if (a[i][0] % 10 == 0) {
				a[i][1] = a[i][0];
			} else {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			}
			max = Math.max(max, a[i][1] - a[i][0]);
			sum += a[i][1];
		} a[i][0] = sc.nextInt() a[i][0] a[i] a i 0 sc.nextInt() sc.nextInt sc if (a[i][0] % 10 == 0) {
				a[i][1] = a[i][0];
			} else {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			} a[i][0] % 10 == 0 a[i][0] % 10 a[i][0] a[i] a i 0 10 0 {
				a[i][1] = a[i][0];
			} a[i][1] = a[i][0] a[i][1] a[i] a i 1 a[i][0] a[i] a i 0 {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			} a[i][1] = (a[i][0] / 10 + 1) * 10 a[i][1] a[i] a i 1 (a[i][0] / 10 + 1) * 10 (a[i][0] / 10 + 1) a[i][0] / 10 a[i][0] a[i] a i 0 10 1 10 max = Math.max(max, a[i][1] - a[i][0]) max Math.max(max, a[i][1] - a[i][0]) Math.max Math max a[i][1] - a[i][0] a[i][1] a[i] a i 1 a[i][0] a[i] a i 0 sum += a[i][1] sum a[i][1] a[i] a i 1 sum = sum - max sum sum - max sum max 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);
		StringBuilder sb = new StringBuilder();
		int[][] a = new int[5][2];
		int max = 0, sum = 0;
		for (int i = 0; i < 5; i++) {
			a[i][0] = sc.nextInt();
			if (a[i][0] % 10 == 0) {
				a[i][1] = a[i][0];
			} else {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			}
			max = Math.max(max, a[i][1] - a[i][0]);
			sum += a[i][1];
		}
		sum = sum - max;
		System.out.println(sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int[][] a = new int[5][2];
		int max = 0, sum = 0;
		for (int i = 0; i < 5; i++) {
			a[i][0] = sc.nextInt();
			if (a[i][0] % 10 == 0) {
				a[i][1] = a[i][0];
			} else {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			}
			max = Math.max(max, a[i][1] - a[i][0]);
			sum += a[i][1];
		}
		sum = sum - max;
		System.out.println(sum);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int[][] a = new int[5][2];
		int max = 0, sum = 0;
		for (int i = 0; i < 5; i++) {
			a[i][0] = sc.nextInt();
			if (a[i][0] % 10 == 0) {
				a[i][1] = a[i][0];
			} else {
				a[i][1] = (a[i][0] / 10 + 1) * 10;
			}
			max = Math.max(max, a[i][1] - a[i][0]);
			sum += a[i][1];
		}
		sum = sum - max;
		System.out.println(sum);
	}
}