import java.util.*;

public class Main{
	public static void main(String[] args) throws Exception {
		Scanner s = new Scanner(System.in);
		int N = 5, sum = 0, n = 10;
		int[] t = new int [N];
		for (int i = 0; i < N; i++){
			t[i] = s.nextInt();
			int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10};
			// System.out.println(T[0] + " " + T[1]);
			sum += T[0];
			// System.out.println(sum);
			if (T[1] < n && T[1] != 0) n = T[1];
			// System.out.println(n);
			// System.out.println();
		}
		System.out.println(sum * 10 + n - 10);
		/*
		29 20 7 35 120 ->215
		101 86 119 108 57 -> 481
		*/
		
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args) throws Exception {
		Scanner s = new Scanner(System.in);
		int N = 5, sum = 0, n = 10;
		int[] t = new int [N];
		for (int i = 0; i < N; i++){
			t[i] = s.nextInt();
			int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10};
			// System.out.println(T[0] + " " + T[1]);
			sum += T[0];
			// System.out.println(sum);
			if (T[1] < n && T[1] != 0) n = T[1];
			// System.out.println(n);
			// System.out.println();
		}
		System.out.println(sum * 10 + n - 10);
		/*
		29 20 7 35 120 ->215
		101 86 119 108 57 -> 481
		*/
		
	}
} Main public static void main(String[] args) throws Exception {
		Scanner s = new Scanner(System.in);
		int N = 5, sum = 0, n = 10;
		int[] t = new int [N];
		for (int i = 0; i < N; i++){
			t[i] = s.nextInt();
			int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10};
			// System.out.println(T[0] + " " + T[1]);
			sum += T[0];
			// System.out.println(sum);
			if (T[1] < n && T[1] != 0) n = T[1];
			// System.out.println(n);
			// System.out.println();
		}
		System.out.println(sum * 10 + n - 10);
		/*
		29 20 7 35 120 ->215
		101 86 119 108 57 -> 481
		*/
		
	} main {
		Scanner s = new Scanner(System.in);
		int N = 5, sum = 0, n = 10;
		int[] t = new int [N];
		for (int i = 0; i < N; i++){
			t[i] = s.nextInt();
			int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10};
			// System.out.println(T[0] + " " + T[1]);
			sum += T[0];
			// System.out.println(sum);
			if (T[1] < n && T[1] != 0) n = T[1];
			// System.out.println(n);
			// System.out.println();
		}
		System.out.println(sum * 10 + n - 10);
		/*
		29 20 7 35 120 ->215
		101 86 119 108 57 -> 481
		*/
		
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int N = 5 N 5 sum = 0 sum 0 n = 10; n 10 int[] t = new int [N]; t new int [N] N for (int i = 0; i < N; i++){
			t[i] = s.nextInt();
			int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10};
			// System.out.println(T[0] + " " + T[1]);
			sum += T[0];
			// System.out.println(sum);
			if (T[1] < n && T[1] != 0) n = T[1];
			// System.out.println(n);
			// System.out.println();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			t[i] = s.nextInt();
			int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10};
			// System.out.println(T[0] + " " + T[1]);
			sum += T[0];
			// System.out.println(sum);
			if (T[1] < n && T[1] != 0) n = T[1];
			// System.out.println(n);
			// System.out.println();
		} {
			t[i] = s.nextInt();
			int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10};
			// System.out.println(T[0] + " " + T[1]);
			sum += T[0];
			// System.out.println(sum);
			if (T[1] < n && T[1] != 0) n = T[1];
			// System.out.println(n);
			// System.out.println();
		} t[i] = s.nextInt() t[i] t i s.nextInt() s.nextInt s int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10}; T {(int)Math.ceil(t[i] / 10.0), t[i] % 10} (int)Math.ceil(t[i] / 10.0) Math.ceil Math t[i] / 10.0 t[i] t i 10.0 t[i] % 10 t[i] t i 10 sum += T[0] sum T[0] T 0 if (T[1] < n && T[1] != 0) n = T[1]; T[1] < n && T[1] != 0 T[1] < n T[1] T 1 n T[1] != 0 T[1] T 1 0 n = T[1] n T[1] T 1 System.out.println(sum * 10 + n - 10) System.out.println System.out System System.out sum * 10 + n - 10 sum * 10 + n sum * 10 sum 10 n 10 String[] args args public class Main{
	public static void main(String[] args) throws Exception {
		Scanner s = new Scanner(System.in);
		int N = 5, sum = 0, n = 10;
		int[] t = new int [N];
		for (int i = 0; i < N; i++){
			t[i] = s.nextInt();
			int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10};
			// System.out.println(T[0] + " " + T[1]);
			sum += T[0];
			// System.out.println(sum);
			if (T[1] < n && T[1] != 0) n = T[1];
			// System.out.println(n);
			// System.out.println();
		}
		System.out.println(sum * 10 + n - 10);
		/*
		29 20 7 35 120 ->215
		101 86 119 108 57 -> 481
		*/
		
	}
} public class Main{
	public static void main(String[] args) throws Exception {
		Scanner s = new Scanner(System.in);
		int N = 5, sum = 0, n = 10;
		int[] t = new int [N];
		for (int i = 0; i < N; i++){
			t[i] = s.nextInt();
			int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10};
			// System.out.println(T[0] + " " + T[1]);
			sum += T[0];
			// System.out.println(sum);
			if (T[1] < n && T[1] != 0) n = T[1];
			// System.out.println(n);
			// System.out.println();
		}
		System.out.println(sum * 10 + n - 10);
		/*
		29 20 7 35 120 ->215
		101 86 119 108 57 -> 481
		*/
		
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args) throws Exception {
		Scanner s = new Scanner(System.in);
		int N = 5, sum = 0, n = 10;
		int[] t = new int [N];
		for (int i = 0; i < N; i++){
			t[i] = s.nextInt();
			int[] T = {(int)Math.ceil(t[i] / 10.0), t[i] % 10};
			// System.out.println(T[0] + " " + T[1]);
			sum += T[0];
			// System.out.println(sum);
			if (T[1] < n && T[1] != 0) n = T[1];
			// System.out.println(n);
			// System.out.println();
		}
		System.out.println(sum * 10 + n - 10);
		/*
		29 20 7 35 120 ->215
		101 86 119 108 57 -> 481
		*/
		
	}
}
