import java.util.*;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int sum = 0;
		int time[] = new int[5];
		int amari[] = new int[5];
		
		for(int i=0; i< 5; i++){
			time[i] = keyboard.nextInt();
			amari[i] = time[i]%10;
			sum += ((time[i]  +9)/10)*10;
		}
		
		Arrays.sort(amari);
		
		int ans = 10;
        for(int j = 0; j <5; j++){
        	if(amari[j] != 0){
	        	ans = amari[j];
		        break;
				}
			}
			
		System.out.println(sum - (10-ans));
		keyboard.close();	
	}
} import java.util.*; util.* java public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int sum = 0;
		int time[] = new int[5];
		int amari[] = new int[5];
		
		for(int i=0; i< 5; i++){
			time[i] = keyboard.nextInt();
			amari[i] = time[i]%10;
			sum += ((time[i]  +9)/10)*10;
		}
		
		Arrays.sort(amari);
		
		int ans = 10;
        for(int j = 0; j <5; j++){
        	if(amari[j] != 0){
	        	ans = amari[j];
		        break;
				}
			}
			
		System.out.println(sum - (10-ans));
		keyboard.close();	
	}
} Main public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int sum = 0;
		int time[] = new int[5];
		int amari[] = new int[5];
		
		for(int i=0; i< 5; i++){
			time[i] = keyboard.nextInt();
			amari[i] = time[i]%10;
			sum += ((time[i]  +9)/10)*10;
		}
		
		Arrays.sort(amari);
		
		int ans = 10;
        for(int j = 0; j <5; j++){
        	if(amari[j] != 0){
	        	ans = amari[j];
		        break;
				}
			}
			
		System.out.println(sum - (10-ans));
		keyboard.close();	
	} main {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int sum = 0;
		int time[] = new int[5];
		int amari[] = new int[5];
		
		for(int i=0; i< 5; i++){
			time[i] = keyboard.nextInt();
			amari[i] = time[i]%10;
			sum += ((time[i]  +9)/10)*10;
		}
		
		Arrays.sort(amari);
		
		int ans = 10;
        for(int j = 0; j <5; j++){
        	if(amari[j] != 0){
	        	ans = amari[j];
		        break;
				}
			}
			
		System.out.println(sum - (10-ans));
		keyboard.close();	
	} Scanner keyboard = new Scanner(System.in); keyboard new Scanner(System.in) int sum = 0; sum 0 int time[] = new int[5]; time new int[5] 5 int amari[] = new int[5]; amari new int[5] 5 for(int i=0; i< 5; i++){
			time[i] = keyboard.nextInt();
			amari[i] = time[i]%10;
			sum += ((time[i]  +9)/10)*10;
		} int i=0; int i=0; i 0 i< 5 i 5 i++ i++ i {
			time[i] = keyboard.nextInt();
			amari[i] = time[i]%10;
			sum += ((time[i]  +9)/10)*10;
		} {
			time[i] = keyboard.nextInt();
			amari[i] = time[i]%10;
			sum += ((time[i]  +9)/10)*10;
		} time[i] = keyboard.nextInt() time[i] time i keyboard.nextInt() keyboard.nextInt keyboard amari[i] = time[i]%10 amari[i] amari i time[i]%10 time[i] time i 10 sum += ((time[i]  +9)/10)*10 sum ((time[i]  +9)/10)*10 ((time[i]  +9)/10) (time[i]  +9) time[i] time i 9 10 10 Arrays.sort(amari) Arrays.sort Arrays amari int ans = 10; ans 10 for(int j = 0; j <5; j++){
        	if(amari[j] != 0){
	        	ans = amari[j];
		        break;
				}
			} int j = 0; int j = 0; j 0 j <5 j 5 j++ j++ j {
        	if(amari[j] != 0){
	        	ans = amari[j];
		        break;
				}
			} {
        	if(amari[j] != 0){
	        	ans = amari[j];
		        break;
				}
			} if(amari[j] != 0){
	        	ans = amari[j];
		        break;
				} amari[j] != 0 amari[j] amari j 0 {
	        	ans = amari[j];
		        break;
				} ans = amari[j] ans amari[j] amari j break; System.out.println(sum - (10-ans)) System.out.println System.out System System.out sum - (10-ans) sum (10-ans) 10 ans keyboard.close() keyboard.close keyboard String[] args args public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int sum = 0;
		int time[] = new int[5];
		int amari[] = new int[5];
		
		for(int i=0; i< 5; i++){
			time[i] = keyboard.nextInt();
			amari[i] = time[i]%10;
			sum += ((time[i]  +9)/10)*10;
		}
		
		Arrays.sort(amari);
		
		int ans = 10;
        for(int j = 0; j <5; j++){
        	if(amari[j] != 0){
	        	ans = amari[j];
		        break;
				}
			}
			
		System.out.println(sum - (10-ans));
		keyboard.close();	
	}
} public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int sum = 0;
		int time[] = new int[5];
		int amari[] = new int[5];
		
		for(int i=0; i< 5; i++){
			time[i] = keyboard.nextInt();
			amari[i] = time[i]%10;
			sum += ((time[i]  +9)/10)*10;
		}
		
		Arrays.sort(amari);
		
		int ans = 10;
        for(int j = 0; j <5; j++){
        	if(amari[j] != 0){
	        	ans = amari[j];
		        break;
				}
			}
			
		System.out.println(sum - (10-ans));
		keyboard.close();	
	}
} Main
import java.util.*;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int sum = 0;
		int time[] = new int[5];
		int amari[] = new int[5];
		
		for(int i=0; i< 5; i++){
			time[i] = keyboard.nextInt();
			amari[i] = time[i]%10;
			sum += ((time[i]  +9)/10)*10;
		}
		
		Arrays.sort(amari);
		
		int ans = 10;
        for(int j = 0; j <5; j++){
        	if(amari[j] != 0){
	        	ans = amari[j];
		        break;
				}
			}
			
		System.out.println(sum - (10-ans));
		keyboard.close();	
	}
}
