import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		int x[] = new int[5];
		int y =1000009;
		int sum = 0;
		for (int n = 0; n < 5; n++) {
			x[n] = stdin.nextInt();
			if (x[n] % 10 != 0) {
				sum = sum + (x[n] / 10 + 1) * 10;
			} else {
				sum = sum + x[n];
			}
			if ((x[n] % 10) <= (y % 10)&&x[n]%10!=0) {
				y = x[n];
			}
		}
			sum = sum - (y / 10 + 1) * 10 + y;
			if(x[0]%10==0&&x[1]%10==0&&x[2]%10==0&&x[3]%10==0&&x[4]%10==0) {
				sum = sum +1;
			}

		
		System.out.println(sum);

	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		int x[] = new int[5];
		int y =1000009;
		int sum = 0;
		for (int n = 0; n < 5; n++) {
			x[n] = stdin.nextInt();
			if (x[n] % 10 != 0) {
				sum = sum + (x[n] / 10 + 1) * 10;
			} else {
				sum = sum + x[n];
			}
			if ((x[n] % 10) <= (y % 10)&&x[n]%10!=0) {
				y = x[n];
			}
		}
			sum = sum - (y / 10 + 1) * 10 + y;
			if(x[0]%10==0&&x[1]%10==0&&x[2]%10==0&&x[3]%10==0&&x[4]%10==0) {
				sum = sum +1;
			}

		
		System.out.println(sum);

	}
} Main public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		int x[] = new int[5];
		int y =1000009;
		int sum = 0;
		for (int n = 0; n < 5; n++) {
			x[n] = stdin.nextInt();
			if (x[n] % 10 != 0) {
				sum = sum + (x[n] / 10 + 1) * 10;
			} else {
				sum = sum + x[n];
			}
			if ((x[n] % 10) <= (y % 10)&&x[n]%10!=0) {
				y = x[n];
			}
		}
			sum = sum - (y / 10 + 1) * 10 + y;
			if(x[0]%10==0&&x[1]%10==0&&x[2]%10==0&&x[3]%10==0&&x[4]%10==0) {
				sum = sum +1;
			}

		
		System.out.println(sum);

	} main {
		Scanner stdin = new Scanner(System.in);
		int x[] = new int[5];
		int y =1000009;
		int sum = 0;
		for (int n = 0; n < 5; n++) {
			x[n] = stdin.nextInt();
			if (x[n] % 10 != 0) {
				sum = sum + (x[n] / 10 + 1) * 10;
			} else {
				sum = sum + x[n];
			}
			if ((x[n] % 10) <= (y % 10)&&x[n]%10!=0) {
				y = x[n];
			}
		}
			sum = sum - (y / 10 + 1) * 10 + y;
			if(x[0]%10==0&&x[1]%10==0&&x[2]%10==0&&x[3]%10==0&&x[4]%10==0) {
				sum = sum +1;
			}

		
		System.out.println(sum);

	} Scanner stdin = new Scanner(System.in); stdin new Scanner(System.in) int x[] = new int[5]; x new int[5] 5 int y =1000009; y 1000009 int sum = 0; sum 0 for (int n = 0; n < 5; n++) {
			x[n] = stdin.nextInt();
			if (x[n] % 10 != 0) {
				sum = sum + (x[n] / 10 + 1) * 10;
			} else {
				sum = sum + x[n];
			}
			if ((x[n] % 10) <= (y % 10)&&x[n]%10!=0) {
				y = x[n];
			}
		} int n = 0; int n = 0; n 0 n < 5 n 5 n++ n++ n {
			x[n] = stdin.nextInt();
			if (x[n] % 10 != 0) {
				sum = sum + (x[n] / 10 + 1) * 10;
			} else {
				sum = sum + x[n];
			}
			if ((x[n] % 10) <= (y % 10)&&x[n]%10!=0) {
				y = x[n];
			}
		} {
			x[n] = stdin.nextInt();
			if (x[n] % 10 != 0) {
				sum = sum + (x[n] / 10 + 1) * 10;
			} else {
				sum = sum + x[n];
			}
			if ((x[n] % 10) <= (y % 10)&&x[n]%10!=0) {
				y = x[n];
			}
		} x[n] = stdin.nextInt() x[n] x n stdin.nextInt() stdin.nextInt stdin if (x[n] % 10 != 0) {
				sum = sum + (x[n] / 10 + 1) * 10;
			} else {
				sum = sum + x[n];
			} x[n] % 10 != 0 x[n] % 10 x[n] x n 10 0 {
				sum = sum + (x[n] / 10 + 1) * 10;
			} sum = sum + (x[n] / 10 + 1) * 10 sum sum + (x[n] / 10 + 1) * 10 sum (x[n] / 10 + 1) * 10 (x[n] / 10 + 1) x[n] / 10 x[n] x n 10 1 10 {
				sum = sum + x[n];
			} sum = sum + x[n] sum sum + x[n] sum x[n] x n if ((x[n] % 10) <= (y % 10)&&x[n]%10!=0) {
				y = x[n];
			} (x[n] % 10) <= (y % 10)&&x[n]%10!=0 (x[n] % 10) <= (y % 10) (x[n] % 10) x[n] x n 10 (y % 10) y 10 x[n]%10!=0 x[n]%10 x[n] x n 10 0 {
				y = x[n];
			} y = x[n] y x[n] x n sum = sum - (y / 10 + 1) * 10 + y sum sum - (y / 10 + 1) * 10 + y sum - (y / 10 + 1) * 10 sum (y / 10 + 1) * 10 (y / 10 + 1) y / 10 y 10 1 10 y if(x[0]%10==0&&x[1]%10==0&&x[2]%10==0&&x[3]%10==0&&x[4]%10==0) {
				sum = sum +1;
			} x[0]%10==0&&x[1]%10==0&&x[2]%10==0&&x[3]%10==0&&x[4]%10==0 x[3]%10==0 x[2]%10==0 x[0]%10==0&&x[1]%10==0&&x[2]%10==0&&x[3]%10==0&&x[4]%10==0 x[0]%10==0 x[0]%10 x[0] x 0 10 0 x[1]%10==0 x[1]%10 x[1] x 1 10 0 x[2]%10==0 x[2]%10 x[2] x 2 10 0 x[3]%10==0 x[3]%10 x[3] x 3 10 0 x[4]%10==0 x[4]%10 x[4] x 4 10 0 {
				sum = sum +1;
			} sum = sum +1 sum sum +1 sum 1 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 stdin = new Scanner(System.in);
		int x[] = new int[5];
		int y =1000009;
		int sum = 0;
		for (int n = 0; n < 5; n++) {
			x[n] = stdin.nextInt();
			if (x[n] % 10 != 0) {
				sum = sum + (x[n] / 10 + 1) * 10;
			} else {
				sum = sum + x[n];
			}
			if ((x[n] % 10) <= (y % 10)&&x[n]%10!=0) {
				y = x[n];
			}
		}
			sum = sum - (y / 10 + 1) * 10 + y;
			if(x[0]%10==0&&x[1]%10==0&&x[2]%10==0&&x[3]%10==0&&x[4]%10==0) {
				sum = sum +1;
			}

		
		System.out.println(sum);

	}
} public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		int x[] = new int[5];
		int y =1000009;
		int sum = 0;
		for (int n = 0; n < 5; n++) {
			x[n] = stdin.nextInt();
			if (x[n] % 10 != 0) {
				sum = sum + (x[n] / 10 + 1) * 10;
			} else {
				sum = sum + x[n];
			}
			if ((x[n] % 10) <= (y % 10)&&x[n]%10!=0) {
				y = x[n];
			}
		}
			sum = sum - (y / 10 + 1) * 10 + y;
			if(x[0]%10==0&&x[1]%10==0&&x[2]%10==0&&x[3]%10==0&&x[4]%10==0) {
				sum = sum +1;
			}

		
		System.out.println(sum);

	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		int x[] = new int[5];
		int y =1000009;
		int sum = 0;
		for (int n = 0; n < 5; n++) {
			x[n] = stdin.nextInt();
			if (x[n] % 10 != 0) {
				sum = sum + (x[n] / 10 + 1) * 10;
			} else {
				sum = sum + x[n];
			}
			if ((x[n] % 10) <= (y % 10)&&x[n]%10!=0) {
				y = x[n];
			}
		}
			sum = sum - (y / 10 + 1) * 10 + y;
			if(x[0]%10==0&&x[1]%10==0&&x[2]%10==0&&x[3]%10==0&&x[4]%10==0) {
				sum = sum +1;
			}

		
		System.out.println(sum);

	}
}