import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main { 
	public static void main(String[] args) {
		
		InputStream input = System.in;
		Scanner in = new Scanner(input);
		int[] allInt = new int[5];
		for(int i = 0;i<5;i++) {
			allInt[i] = Integer.parseInt(in.next());
		}
		int[] total = new int[5];
		
		for(int i = 0;i<5;i++) {
			total[i] = 0;
			for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			}
			
		}
		Arrays.sort(total);
		
		System.out.println(total[0]);
		
		
	}
}
	
	 import java.io.InputStream; InputStream java.io import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main { 
	public static void main(String[] args) {
		
		InputStream input = System.in;
		Scanner in = new Scanner(input);
		int[] allInt = new int[5];
		for(int i = 0;i<5;i++) {
			allInt[i] = Integer.parseInt(in.next());
		}
		int[] total = new int[5];
		
		for(int i = 0;i<5;i++) {
			total[i] = 0;
			for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			}
			
		}
		Arrays.sort(total);
		
		System.out.println(total[0]);
		
		
	}
} Main public static void main(String[] args) {
		
		InputStream input = System.in;
		Scanner in = new Scanner(input);
		int[] allInt = new int[5];
		for(int i = 0;i<5;i++) {
			allInt[i] = Integer.parseInt(in.next());
		}
		int[] total = new int[5];
		
		for(int i = 0;i<5;i++) {
			total[i] = 0;
			for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			}
			
		}
		Arrays.sort(total);
		
		System.out.println(total[0]);
		
		
	} main {
		
		InputStream input = System.in;
		Scanner in = new Scanner(input);
		int[] allInt = new int[5];
		for(int i = 0;i<5;i++) {
			allInt[i] = Integer.parseInt(in.next());
		}
		int[] total = new int[5];
		
		for(int i = 0;i<5;i++) {
			total[i] = 0;
			for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			}
			
		}
		Arrays.sort(total);
		
		System.out.println(total[0]);
		
		
	} InputStream input = System.in; input System.in System System.in Scanner in = new Scanner(input); in new Scanner(input) int[] allInt = new int[5]; allInt new int[5] 5 for(int i = 0;i<5;i++) {
			allInt[i] = Integer.parseInt(in.next());
		} int i = 0; int i = 0; i 0 i<5 i 5 i++ i++ i {
			allInt[i] = Integer.parseInt(in.next());
		} {
			allInt[i] = Integer.parseInt(in.next());
		} allInt[i] = Integer.parseInt(in.next()) allInt[i] allInt i Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int[] total = new int[5]; total new int[5] 5 for(int i = 0;i<5;i++) {
			total[i] = 0;
			for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			}
			
		} int i = 0; int i = 0; i 0 i<5 i 5 i++ i++ i {
			total[i] = 0;
			for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			}
			
		} {
			total[i] = 0;
			for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			}
			
		} total[i] = 0 total[i] total i 0 for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			} int j = 0; int j = 0; j 0 j<5 j 5 j++ j++ j {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			} {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			} if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				} i == j i j {
					total[i] += allInt[j];
				} total[i] += allInt[j] total[i] total i allInt[j] allInt j {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				} total[i] += allInt[j]/10*10 total[i] total i allInt[j]/10*10 allInt[j]/10 allInt[j] allInt j 10 10 int tmp = allInt[j]%10 == 0 ? 0 : 10; tmp allInt[j]%10 == 0 ? 0 : 10 allInt[j]%10 == 0 allInt[j]%10 allInt[j] allInt j 10 0 0 10 total[i] += tmp total[i] total i tmp Arrays.sort(total) Arrays.sort Arrays total System.out.println(total[0]) System.out.println System.out System System.out total[0] total 0 String[] args args public class Main { 
	public static void main(String[] args) {
		
		InputStream input = System.in;
		Scanner in = new Scanner(input);
		int[] allInt = new int[5];
		for(int i = 0;i<5;i++) {
			allInt[i] = Integer.parseInt(in.next());
		}
		int[] total = new int[5];
		
		for(int i = 0;i<5;i++) {
			total[i] = 0;
			for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			}
			
		}
		Arrays.sort(total);
		
		System.out.println(total[0]);
		
		
	}
} public class Main { 
	public static void main(String[] args) {
		
		InputStream input = System.in;
		Scanner in = new Scanner(input);
		int[] allInt = new int[5];
		for(int i = 0;i<5;i++) {
			allInt[i] = Integer.parseInt(in.next());
		}
		int[] total = new int[5];
		
		for(int i = 0;i<5;i++) {
			total[i] = 0;
			for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			}
			
		}
		Arrays.sort(total);
		
		System.out.println(total[0]);
		
		
	}
} Main
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main { 
	public static void main(String[] args) {
		
		InputStream input = System.in;
		Scanner in = new Scanner(input);
		int[] allInt = new int[5];
		for(int i = 0;i<5;i++) {
			allInt[i] = Integer.parseInt(in.next());
		}
		int[] total = new int[5];
		
		for(int i = 0;i<5;i++) {
			total[i] = 0;
			for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			}
			
		}
		Arrays.sort(total);
		
		System.out.println(total[0]);
		
		
	}
}
	
	