import java.util.Scanner;

public class Main {


	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	    int[] input = new int [5];
	    for(int i = 0; i < input.length; i++) {
	    	input[i] = sc.nextInt();
	    }
	    
	    int lastOrderIndex = input.length-1;
	    int min1digit = Integer.MAX_VALUE;
	    for( int i = 0; i < input.length; i++) {
	    	if( input[i]%10 == 0 ) {
	    		continue;
	    	}
	    	
	    	if( input[i]%10 < min1digit ) {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	}
	    }
	    
	    int sum = 0;
	    for( int i = 0; i < input.length; i++) {
	    	if( i == lastOrderIndex ) {
	    		sum += input[i];
	    	} else if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	}
	    }
    	System.out.println(sum);

		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {


	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	    int[] input = new int [5];
	    for(int i = 0; i < input.length; i++) {
	    	input[i] = sc.nextInt();
	    }
	    
	    int lastOrderIndex = input.length-1;
	    int min1digit = Integer.MAX_VALUE;
	    for( int i = 0; i < input.length; i++) {
	    	if( input[i]%10 == 0 ) {
	    		continue;
	    	}
	    	
	    	if( input[i]%10 < min1digit ) {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	}
	    }
	    
	    int sum = 0;
	    for( int i = 0; i < input.length; i++) {
	    	if( i == lastOrderIndex ) {
	    		sum += input[i];
	    	} else if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	}
	    }
    	System.out.println(sum);

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	    int[] input = new int [5];
	    for(int i = 0; i < input.length; i++) {
	    	input[i] = sc.nextInt();
	    }
	    
	    int lastOrderIndex = input.length-1;
	    int min1digit = Integer.MAX_VALUE;
	    for( int i = 0; i < input.length; i++) {
	    	if( input[i]%10 == 0 ) {
	    		continue;
	    	}
	    	
	    	if( input[i]%10 < min1digit ) {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	}
	    }
	    
	    int sum = 0;
	    for( int i = 0; i < input.length; i++) {
	    	if( i == lastOrderIndex ) {
	    		sum += input[i];
	    	} else if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	}
	    }
    	System.out.println(sum);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
	    int[] input = new int [5];
	    for(int i = 0; i < input.length; i++) {
	    	input[i] = sc.nextInt();
	    }
	    
	    int lastOrderIndex = input.length-1;
	    int min1digit = Integer.MAX_VALUE;
	    for( int i = 0; i < input.length; i++) {
	    	if( input[i]%10 == 0 ) {
	    		continue;
	    	}
	    	
	    	if( input[i]%10 < min1digit ) {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	}
	    }
	    
	    int sum = 0;
	    for( int i = 0; i < input.length; i++) {
	    	if( i == lastOrderIndex ) {
	    		sum += input[i];
	    	} else if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	}
	    }
    	System.out.println(sum);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] input = new int [5]; input new int [5] 5 for(int i = 0; i < input.length; i++) {
	    	input[i] = sc.nextInt();
	    } int i = 0; int i = 0; i 0 i < input.length i input.length input input.length i++ i++ i {
	    	input[i] = sc.nextInt();
	    } {
	    	input[i] = sc.nextInt();
	    } input[i] = sc.nextInt() input[i] input i sc.nextInt() sc.nextInt sc int lastOrderIndex = input.length-1; lastOrderIndex input.length-1 input.length input input.length 1 int min1digit = Integer.MAX_VALUE; min1digit Integer.MAX_VALUE Integer Integer.MAX_VALUE for( int i = 0; i < input.length; i++) {
	    	if( input[i]%10 == 0 ) {
	    		continue;
	    	}
	    	
	    	if( input[i]%10 < min1digit ) {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	}
	    } int i = 0; int i = 0; i 0 i < input.length i input.length input input.length i++ i++ i {
	    	if( input[i]%10 == 0 ) {
	    		continue;
	    	}
	    	
	    	if( input[i]%10 < min1digit ) {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	}
	    } {
	    	if( input[i]%10 == 0 ) {
	    		continue;
	    	}
	    	
	    	if( input[i]%10 < min1digit ) {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	}
	    } if( input[i]%10 == 0 ) {
	    		continue;
	    	} input[i]%10 == 0 input[i]%10 input[i] input i 10 0 {
	    		continue;
	    	} continue; if( input[i]%10 < min1digit ) {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	} input[i]%10 < min1digit input[i]%10 input[i] input i 10 min1digit {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	} min1digit = input[i]%10 min1digit input[i]%10 input[i] input i 10 lastOrderIndex = i lastOrderIndex i int sum = 0; sum 0 for( int i = 0; i < input.length; i++) {
	    	if( i == lastOrderIndex ) {
	    		sum += input[i];
	    	} else if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	}
	    } int i = 0; int i = 0; i 0 i < input.length i input.length input input.length i++ i++ i {
	    	if( i == lastOrderIndex ) {
	    		sum += input[i];
	    	} else if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	}
	    } {
	    	if( i == lastOrderIndex ) {
	    		sum += input[i];
	    	} else if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	}
	    } if( i == lastOrderIndex ) {
	    		sum += input[i];
	    	} else if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	} i == lastOrderIndex i lastOrderIndex {
	    		sum += input[i];
	    	} sum += input[i] sum input[i] input i if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	} input[i]%10 == 0 input[i]%10 input[i] input i 10 0 {
	    		sum += input[i];
	    	} sum += input[i] sum input[i] input i {
	    		sum += input[i] + (10 - input[i]%10);
	    	} sum += input[i] + (10 - input[i]%10) sum input[i] + (10 - input[i]%10) input[i] input i (10 - input[i]%10) 10 input[i]%10 input[i] input i 10 System.out.println(sum) System.out.println System.out System System.out sum sc.close() sc.close sc String[] args args public class Main {


	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	    int[] input = new int [5];
	    for(int i = 0; i < input.length; i++) {
	    	input[i] = sc.nextInt();
	    }
	    
	    int lastOrderIndex = input.length-1;
	    int min1digit = Integer.MAX_VALUE;
	    for( int i = 0; i < input.length; i++) {
	    	if( input[i]%10 == 0 ) {
	    		continue;
	    	}
	    	
	    	if( input[i]%10 < min1digit ) {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	}
	    }
	    
	    int sum = 0;
	    for( int i = 0; i < input.length; i++) {
	    	if( i == lastOrderIndex ) {
	    		sum += input[i];
	    	} else if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	}
	    }
    	System.out.println(sum);

		sc.close();
	}
} public class Main {


	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	    int[] input = new int [5];
	    for(int i = 0; i < input.length; i++) {
	    	input[i] = sc.nextInt();
	    }
	    
	    int lastOrderIndex = input.length-1;
	    int min1digit = Integer.MAX_VALUE;
	    for( int i = 0; i < input.length; i++) {
	    	if( input[i]%10 == 0 ) {
	    		continue;
	    	}
	    	
	    	if( input[i]%10 < min1digit ) {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	}
	    }
	    
	    int sum = 0;
	    for( int i = 0; i < input.length; i++) {
	    	if( i == lastOrderIndex ) {
	    		sum += input[i];
	    	} else if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	}
	    }
    	System.out.println(sum);

		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {


	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	    int[] input = new int [5];
	    for(int i = 0; i < input.length; i++) {
	    	input[i] = sc.nextInt();
	    }
	    
	    int lastOrderIndex = input.length-1;
	    int min1digit = Integer.MAX_VALUE;
	    for( int i = 0; i < input.length; i++) {
	    	if( input[i]%10 == 0 ) {
	    		continue;
	    	}
	    	
	    	if( input[i]%10 < min1digit ) {
	    		min1digit = input[i]%10;
	    		lastOrderIndex = i;
	    	}
	    }
	    
	    int sum = 0;
	    for( int i = 0; i < input.length; i++) {
	    	if( i == lastOrderIndex ) {
	    		sum += input[i];
	    	} else if( input[i]%10 == 0 ) {
	    		sum += input[i];
	    	} else {
	    		sum += input[i] + (10 - input[i]%10);
	    	}
	    }
    	System.out.println(sum);

		sc.close();
	}
}