import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
    
        int amtTime = 0;
        int maxLoss = 10;
        int maxLossNum = 0;
      	boolean a = true;
        
         List<Integer> Array = new ArrayList<>();
        
        while(sc.hasNextInt()) {
        	Array.add((Integer)sc.nextInt());
        }
        
        for(int i = 0; i < Array.size(); i++ ){
            if(Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10){
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            };
        }        
        for(int j = 0; j < Array.size(); j++ ){
            if(Array.get(j) == maxLossNum && a){
                a = false;
              	continue;
            }else{
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            }
        }
        
        	System.out.println(amtTime + maxLossNum);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
    
        int amtTime = 0;
        int maxLoss = 10;
        int maxLossNum = 0;
      	boolean a = true;
        
         List<Integer> Array = new ArrayList<>();
        
        while(sc.hasNextInt()) {
        	Array.add((Integer)sc.nextInt());
        }
        
        for(int i = 0; i < Array.size(); i++ ){
            if(Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10){
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            };
        }        
        for(int j = 0; j < Array.size(); j++ ){
            if(Array.get(j) == maxLossNum && a){
                a = false;
              	continue;
            }else{
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            }
        }
        
        	System.out.println(amtTime + maxLossNum);
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
    
        int amtTime = 0;
        int maxLoss = 10;
        int maxLossNum = 0;
      	boolean a = true;
        
         List<Integer> Array = new ArrayList<>();
        
        while(sc.hasNextInt()) {
        	Array.add((Integer)sc.nextInt());
        }
        
        for(int i = 0; i < Array.size(); i++ ){
            if(Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10){
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            };
        }        
        for(int j = 0; j < Array.size(); j++ ){
            if(Array.get(j) == maxLossNum && a){
                a = false;
              	continue;
            }else{
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            }
        }
        
        	System.out.println(amtTime + maxLossNum);
    } main {

        Scanner sc = new Scanner(System.in);
    
        int amtTime = 0;
        int maxLoss = 10;
        int maxLossNum = 0;
      	boolean a = true;
        
         List<Integer> Array = new ArrayList<>();
        
        while(sc.hasNextInt()) {
        	Array.add((Integer)sc.nextInt());
        }
        
        for(int i = 0; i < Array.size(); i++ ){
            if(Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10){
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            };
        }        
        for(int j = 0; j < Array.size(); j++ ){
            if(Array.get(j) == maxLossNum && a){
                a = false;
              	continue;
            }else{
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            }
        }
        
        	System.out.println(amtTime + maxLossNum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int amtTime = 0; amtTime 0 int maxLoss = 10; maxLoss 10 int maxLossNum = 0; maxLossNum 0 boolean a = true; a true List<Integer> Array = new ArrayList<>(); Array new ArrayList<>() while(sc.hasNextInt()) {
        	Array.add((Integer)sc.nextInt());
        } sc.hasNextInt() sc.hasNextInt sc {
        	Array.add((Integer)sc.nextInt());
        } Array.add((Integer)sc.nextInt()) Array.add Array (Integer)sc.nextInt() sc.nextInt sc for(int i = 0; i < Array.size(); i++ ){
            if(Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10){
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            };
        } int i = 0; int i = 0; i 0 i < Array.size() i Array.size() Array.size Array i++ i++ i {
            if(Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10){
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            };
        } {
            if(Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10){
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            };
        } if(Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10){
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            } Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10 Array.get(i) % 10 != 0 Array.get(i) % 10 Array.get(i) Array.get Array i 10 0 maxLoss > Array.get(i) % 10 maxLoss Array.get(i) % 10 Array.get(i) Array.get Array i 10 {
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            } maxLoss = Array.get(i) % 10 maxLoss Array.get(i) % 10 Array.get(i) Array.get Array i 10 maxLossNum = Array.get(i) maxLossNum Array.get(i) Array.get Array i for(int j = 0; j < Array.size(); j++ ){
            if(Array.get(j) == maxLossNum && a){
                a = false;
              	continue;
            }else{
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            }
        } int j = 0; int j = 0; j 0 j < Array.size() j Array.size() Array.size Array j++ j++ j {
            if(Array.get(j) == maxLossNum && a){
                a = false;
              	continue;
            }else{
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            }
        } {
            if(Array.get(j) == maxLossNum && a){
                a = false;
              	continue;
            }else{
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            }
        } if(Array.get(j) == maxLossNum && a){
                a = false;
              	continue;
            }else{
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            } Array.get(j) == maxLossNum && a Array.get(j) == maxLossNum Array.get(j) Array.get Array j maxLossNum a {
                a = false;
              	continue;
            } a = false a false continue; {
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            } int t = Array.get(j); t Array.get(j) Array.get Array j int rt = t % 10; rt t % 10 t 10 int adj = 0; adj 0 if(rt > 0){
            	    adj = 10 - rt;
            	} rt > 0 rt 0 {
            	    adj = 10 - rt;
            	} adj = 10 - rt adj 10 - rt 10 rt amtTime += t + adj amtTime t + adj t adj System.out.println(amtTime + maxLossNum) System.out.println System.out System System.out amtTime + maxLossNum amtTime maxLossNum String[] args args public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
    
        int amtTime = 0;
        int maxLoss = 10;
        int maxLossNum = 0;
      	boolean a = true;
        
         List<Integer> Array = new ArrayList<>();
        
        while(sc.hasNextInt()) {
        	Array.add((Integer)sc.nextInt());
        }
        
        for(int i = 0; i < Array.size(); i++ ){
            if(Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10){
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            };
        }        
        for(int j = 0; j < Array.size(); j++ ){
            if(Array.get(j) == maxLossNum && a){
                a = false;
              	continue;
            }else{
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            }
        }
        
        	System.out.println(amtTime + maxLossNum);
    }
} public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
    
        int amtTime = 0;
        int maxLoss = 10;
        int maxLossNum = 0;
      	boolean a = true;
        
         List<Integer> Array = new ArrayList<>();
        
        while(sc.hasNextInt()) {
        	Array.add((Integer)sc.nextInt());
        }
        
        for(int i = 0; i < Array.size(); i++ ){
            if(Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10){
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            };
        }        
        for(int j = 0; j < Array.size(); j++ ){
            if(Array.get(j) == maxLossNum && a){
                a = false;
              	continue;
            }else{
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            }
        }
        
        	System.out.println(amtTime + maxLossNum);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
    
        int amtTime = 0;
        int maxLoss = 10;
        int maxLossNum = 0;
      	boolean a = true;
        
         List<Integer> Array = new ArrayList<>();
        
        while(sc.hasNextInt()) {
        	Array.add((Integer)sc.nextInt());
        }
        
        for(int i = 0; i < Array.size(); i++ ){
            if(Array.get(i) % 10 != 0 && maxLoss > Array.get(i) % 10){
                maxLoss = Array.get(i) % 10; 
                maxLossNum = Array.get(i);
            };
        }        
        for(int j = 0; j < Array.size(); j++ ){
            if(Array.get(j) == maxLossNum && a){
                a = false;
              	continue;
            }else{
            	int t = Array.get(j);
            	int rt = t % 10;
            	int adj = 0;
            	if(rt > 0){
            	    adj = 10 - rt;
            	}
            	amtTime += t + adj;
            }
        }
        
        	System.out.println(amtTime + maxLossNum);
    }
}