import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int[]a = new int[5];
    ArrayList<Integer>b = new ArrayList<>();

    int count = 0;
    int all = 0;
    for(int i=0; i<5; i++) {
    	a[i] = sc.nextInt();
    	if(a[i]%10==0) {
    		all += a[i];
    		count++;
    	}
    }
    if(count == 5) {
    	System.out.println(all);
    }else{
    	for(int i=0; i<5; i++) {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	}
    Collections.sort(b);
    int last = 0;
    for(int i=0; i<5; i++) {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    }
    int al = 0;
    int cou = 0;
    for(int i=0; i<5; i++) {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     }
    if(cou != 4) {
    	al += ((last/10)+1)*10*(4-cou);
    }
    System.out.println(al + last);
    }
}
} import java.util.ArrayList; ArrayList 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){
    
    Scanner sc = new Scanner(System.in);
    int[]a = new int[5];
    ArrayList<Integer>b = new ArrayList<>();

    int count = 0;
    int all = 0;
    for(int i=0; i<5; i++) {
    	a[i] = sc.nextInt();
    	if(a[i]%10==0) {
    		all += a[i];
    		count++;
    	}
    }
    if(count == 5) {
    	System.out.println(all);
    }else{
    	for(int i=0; i<5; i++) {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	}
    Collections.sort(b);
    int last = 0;
    for(int i=0; i<5; i++) {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    }
    int al = 0;
    int cou = 0;
    for(int i=0; i<5; i++) {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     }
    if(cou != 4) {
    	al += ((last/10)+1)*10*(4-cou);
    }
    System.out.println(al + last);
    }
}
} Main public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int[]a = new int[5];
    ArrayList<Integer>b = new ArrayList<>();

    int count = 0;
    int all = 0;
    for(int i=0; i<5; i++) {
    	a[i] = sc.nextInt();
    	if(a[i]%10==0) {
    		all += a[i];
    		count++;
    	}
    }
    if(count == 5) {
    	System.out.println(all);
    }else{
    	for(int i=0; i<5; i++) {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	}
    Collections.sort(b);
    int last = 0;
    for(int i=0; i<5; i++) {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    }
    int al = 0;
    int cou = 0;
    for(int i=0; i<5; i++) {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     }
    if(cou != 4) {
    	al += ((last/10)+1)*10*(4-cou);
    }
    System.out.println(al + last);
    }
} main {
    
    Scanner sc = new Scanner(System.in);
    int[]a = new int[5];
    ArrayList<Integer>b = new ArrayList<>();

    int count = 0;
    int all = 0;
    for(int i=0; i<5; i++) {
    	a[i] = sc.nextInt();
    	if(a[i]%10==0) {
    		all += a[i];
    		count++;
    	}
    }
    if(count == 5) {
    	System.out.println(all);
    }else{
    	for(int i=0; i<5; i++) {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	}
    Collections.sort(b);
    int last = 0;
    for(int i=0; i<5; i++) {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    }
    int al = 0;
    int cou = 0;
    for(int i=0; i<5; i++) {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     }
    if(cou != 4) {
    	al += ((last/10)+1)*10*(4-cou);
    }
    System.out.println(al + last);
    }
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[]a = new int[5]; a new int[5] 5 ArrayList<Integer>b = new ArrayList<>(); b new ArrayList<>() int count = 0; count 0 int all = 0; all 0 for(int i=0; i<5; i++) {
    	a[i] = sc.nextInt();
    	if(a[i]%10==0) {
    		all += a[i];
    		count++;
    	}
    } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
    	a[i] = sc.nextInt();
    	if(a[i]%10==0) {
    		all += a[i];
    		count++;
    	}
    } {
    	a[i] = sc.nextInt();
    	if(a[i]%10==0) {
    		all += a[i];
    		count++;
    	}
    } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(a[i]%10==0) {
    		all += a[i];
    		count++;
    	} a[i]%10==0 a[i]%10 a[i] a i 10 0 {
    		all += a[i];
    		count++;
    	} all += a[i] all a[i] a i count++ count if(count == 5) {
    	System.out.println(all);
    }else{
    	for(int i=0; i<5; i++) {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	}
    Collections.sort(b);
    int last = 0;
    for(int i=0; i<5; i++) {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    }
    int al = 0;
    int cou = 0;
    for(int i=0; i<5; i++) {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     }
    if(cou != 4) {
    	al += ((last/10)+1)*10*(4-cou);
    }
    System.out.println(al + last);
    } count == 5 count 5 {
    	System.out.println(all);
    } System.out.println(all) System.out.println System.out System System.out all {
    	for(int i=0; i<5; i++) {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	}
    Collections.sort(b);
    int last = 0;
    for(int i=0; i<5; i++) {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    }
    int al = 0;
    int cou = 0;
    for(int i=0; i<5; i++) {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     }
    if(cou != 4) {
    	al += ((last/10)+1)*10*(4-cou);
    }
    System.out.println(al + last);
    } for(int i=0; i<5; i++) {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	} {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	} if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	} a[i]%10 != 0 a[i]%10 a[i] a i 10 0 {
    		b.add(a[i]%10); 
    	} b.add(a[i]%10) b.add b a[i]%10 a[i] a i 10 Collections.sort(b) Collections.sort Collections b int last = 0; last 0 for(int i=0; i<5; i++) {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    } {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    } if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	} a[i]%10 == b.get(0) a[i]%10 a[i] a i 10 b.get(0) b.get b 0 {
    		last = a[i];
    		break;
    	} last = a[i] last a[i] a i break; int al = 0; al 0 int cou = 0; cou 0 for(int i=0; i<5; i++) {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     } {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     } if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	} a[i] != last a[i] a i last {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	} if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		} a[i]%10==0 a[i]%10 a[i] a i 10 0 {
    			al += a[i];
    		} al += a[i] al a[i] a i {
    			al += ((a[i]/10)+1)*10;
    		} al += ((a[i]/10)+1)*10 al ((a[i]/10)+1)*10 ((a[i]/10)+1) (a[i]/10) a[i] a i 10 1 10 cou++ cou if(cou != 4) {
    	al += ((last/10)+1)*10*(4-cou);
    } cou != 4 cou 4 {
    	al += ((last/10)+1)*10*(4-cou);
    } al += ((last/10)+1)*10*(4-cou) al ((last/10)+1)*10*(4-cou) ((last/10)+1)*10*(4-cou) ((last/10)+1) (last/10) last 10 1 10 (4-cou) 4 cou System.out.println(al + last) System.out.println System.out System System.out al + last al last String[] args args public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int[]a = new int[5];
    ArrayList<Integer>b = new ArrayList<>();

    int count = 0;
    int all = 0;
    for(int i=0; i<5; i++) {
    	a[i] = sc.nextInt();
    	if(a[i]%10==0) {
    		all += a[i];
    		count++;
    	}
    }
    if(count == 5) {
    	System.out.println(all);
    }else{
    	for(int i=0; i<5; i++) {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	}
    Collections.sort(b);
    int last = 0;
    for(int i=0; i<5; i++) {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    }
    int al = 0;
    int cou = 0;
    for(int i=0; i<5; i++) {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     }
    if(cou != 4) {
    	al += ((last/10)+1)*10*(4-cou);
    }
    System.out.println(al + last);
    }
}
} public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int[]a = new int[5];
    ArrayList<Integer>b = new ArrayList<>();

    int count = 0;
    int all = 0;
    for(int i=0; i<5; i++) {
    	a[i] = sc.nextInt();
    	if(a[i]%10==0) {
    		all += a[i];
    		count++;
    	}
    }
    if(count == 5) {
    	System.out.println(all);
    }else{
    	for(int i=0; i<5; i++) {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	}
    Collections.sort(b);
    int last = 0;
    for(int i=0; i<5; i++) {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    }
    int al = 0;
    int cou = 0;
    for(int i=0; i<5; i++) {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     }
    if(cou != 4) {
    	al += ((last/10)+1)*10*(4-cou);
    }
    System.out.println(al + last);
    }
}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int[]a = new int[5];
    ArrayList<Integer>b = new ArrayList<>();

    int count = 0;
    int all = 0;
    for(int i=0; i<5; i++) {
    	a[i] = sc.nextInt();
    	if(a[i]%10==0) {
    		all += a[i];
    		count++;
    	}
    }
    if(count == 5) {
    	System.out.println(all);
    }else{
    	for(int i=0; i<5; i++) {
       	if(a[i]%10 != 0) {
    		b.add(a[i]%10); 
    	}
    	}
    Collections.sort(b);
    int last = 0;
    for(int i=0; i<5; i++) {
    	if(a[i]%10 == b.get(0)) {
    		last = a[i];
    		break;
    	}
    }
    int al = 0;
    int cou = 0;
    for(int i=0; i<5; i++) {
    	if(a[i] != last) {
    		if(a[i]%10==0) {
    			al += a[i];
    		}else {
    			al += ((a[i]/10)+1)*10;
    		}
    		cou++;
    	}
     }
    if(cou != 4) {
    	al += ((last/10)+1)*10*(4-cou);
    }
    System.out.println(al + last);
    }
}
}