import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int[] x = new int[5];
		int y = 10;
		int sum = -10;
		for(int i = 0;i<5;i++) {
			x[i]=scn.nextInt()-1;
			if(x[i]%10<y) {
				y=x[i]%10+1;
			}
			x[i] = x[i]/10+1;
		}
		for(int z:x) {
			sum+=10*z;
		}
		sum+=y;
		System.out.println(sum);
		scn.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int[] x = new int[5];
		int y = 10;
		int sum = -10;
		for(int i = 0;i<5;i++) {
			x[i]=scn.nextInt()-1;
			if(x[i]%10<y) {
				y=x[i]%10+1;
			}
			x[i] = x[i]/10+1;
		}
		for(int z:x) {
			sum+=10*z;
		}
		sum+=y;
		System.out.println(sum);
		scn.close();
	}
} Main public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int[] x = new int[5];
		int y = 10;
		int sum = -10;
		for(int i = 0;i<5;i++) {
			x[i]=scn.nextInt()-1;
			if(x[i]%10<y) {
				y=x[i]%10+1;
			}
			x[i] = x[i]/10+1;
		}
		for(int z:x) {
			sum+=10*z;
		}
		sum+=y;
		System.out.println(sum);
		scn.close();
	} main {
		Scanner scn = new Scanner(System.in);
		int[] x = new int[5];
		int y = 10;
		int sum = -10;
		for(int i = 0;i<5;i++) {
			x[i]=scn.nextInt()-1;
			if(x[i]%10<y) {
				y=x[i]%10+1;
			}
			x[i] = x[i]/10+1;
		}
		for(int z:x) {
			sum+=10*z;
		}
		sum+=y;
		System.out.println(sum);
		scn.close();
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int[] x = new int[5]; x new int[5] 5 int y = 10; y 10 int sum = -10; sum -10 10 for(int i = 0;i<5;i++) {
			x[i]=scn.nextInt()-1;
			if(x[i]%10<y) {
				y=x[i]%10+1;
			}
			x[i] = x[i]/10+1;
		} int i = 0; int i = 0; i 0 i<5 i 5 i++ i++ i {
			x[i]=scn.nextInt()-1;
			if(x[i]%10<y) {
				y=x[i]%10+1;
			}
			x[i] = x[i]/10+1;
		} {
			x[i]=scn.nextInt()-1;
			if(x[i]%10<y) {
				y=x[i]%10+1;
			}
			x[i] = x[i]/10+1;
		} x[i]=scn.nextInt()-1 x[i] x i scn.nextInt()-1 scn.nextInt() scn.nextInt scn 1 if(x[i]%10<y) {
				y=x[i]%10+1;
			} x[i]%10<y x[i]%10 x[i] x i 10 y {
				y=x[i]%10+1;
			} y=x[i]%10+1 y x[i]%10+1 x[i]%10 x[i] x i 10 1 x[i] = x[i]/10+1 x[i] x i x[i]/10+1 x[i]/10 x[i] x i 10 1 for(int z:x) {
			sum+=10*z;
		} int z x {
			sum+=10*z;
		} {
			sum+=10*z;
		} sum+=10*z sum 10*z 10 z sum+=y sum y System.out.println(sum) System.out.println System.out System System.out sum scn.close() scn.close scn String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int[] x = new int[5];
		int y = 10;
		int sum = -10;
		for(int i = 0;i<5;i++) {
			x[i]=scn.nextInt()-1;
			if(x[i]%10<y) {
				y=x[i]%10+1;
			}
			x[i] = x[i]/10+1;
		}
		for(int z:x) {
			sum+=10*z;
		}
		sum+=y;
		System.out.println(sum);
		scn.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int[] x = new int[5];
		int y = 10;
		int sum = -10;
		for(int i = 0;i<5;i++) {
			x[i]=scn.nextInt()-1;
			if(x[i]%10<y) {
				y=x[i]%10+1;
			}
			x[i] = x[i]/10+1;
		}
		for(int z:x) {
			sum+=10*z;
		}
		sum+=y;
		System.out.println(sum);
		scn.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int[] x = new int[5];
		int y = 10;
		int sum = -10;
		for(int i = 0;i<5;i++) {
			x[i]=scn.nextInt()-1;
			if(x[i]%10<y) {
				y=x[i]%10+1;
			}
			x[i] = x[i]/10+1;
		}
		for(int z:x) {
			sum+=10*z;
		}
		sum+=y;
		System.out.println(sum);
		scn.close();
	}
}