import java.util.*;
 
public class Main {
    public static void main(String args[]) {
       //値の取得
       Scanner sc = new Scanner(System.in);
       int[] time = new int[5];
       for(int i = 0; i < 5; ++i){
           time[i] = sc.nextInt();
       }
       
       int dish[] = new int[5];
       
       for(int i = 0; i < 5; ++i){
           if(time[i]%10==0){
               dish[i] = (time[i]/10)*10;
           }else{
               dish[i] = (time[i]/10)*10 +10;
           }
       }
       
       int max = 0;
       int total = 0; 
       for(int i = 0; i < 5; ++i) {
           if(Math.abs(dish[i] - time[i]) > max) {
               max = Math.abs(dish[i] - time[i]); 
           }
           
           total += dish[i];
       }
       System.out.println(total - max);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) {
       //値の取得
       Scanner sc = new Scanner(System.in);
       int[] time = new int[5];
       for(int i = 0; i < 5; ++i){
           time[i] = sc.nextInt();
       }
       
       int dish[] = new int[5];
       
       for(int i = 0; i < 5; ++i){
           if(time[i]%10==0){
               dish[i] = (time[i]/10)*10;
           }else{
               dish[i] = (time[i]/10)*10 +10;
           }
       }
       
       int max = 0;
       int total = 0; 
       for(int i = 0; i < 5; ++i) {
           if(Math.abs(dish[i] - time[i]) > max) {
               max = Math.abs(dish[i] - time[i]); 
           }
           
           total += dish[i];
       }
       System.out.println(total - max);
    }
} Main public static void main(String args[]) {
       //値の取得
       Scanner sc = new Scanner(System.in);
       int[] time = new int[5];
       for(int i = 0; i < 5; ++i){
           time[i] = sc.nextInt();
       }
       
       int dish[] = new int[5];
       
       for(int i = 0; i < 5; ++i){
           if(time[i]%10==0){
               dish[i] = (time[i]/10)*10;
           }else{
               dish[i] = (time[i]/10)*10 +10;
           }
       }
       
       int max = 0;
       int total = 0; 
       for(int i = 0; i < 5; ++i) {
           if(Math.abs(dish[i] - time[i]) > max) {
               max = Math.abs(dish[i] - time[i]); 
           }
           
           total += dish[i];
       }
       System.out.println(total - max);
    } main {
       //値の取得
       Scanner sc = new Scanner(System.in);
       int[] time = new int[5];
       for(int i = 0; i < 5; ++i){
           time[i] = sc.nextInt();
       }
       
       int dish[] = new int[5];
       
       for(int i = 0; i < 5; ++i){
           if(time[i]%10==0){
               dish[i] = (time[i]/10)*10;
           }else{
               dish[i] = (time[i]/10)*10 +10;
           }
       }
       
       int max = 0;
       int total = 0; 
       for(int i = 0; i < 5; ++i) {
           if(Math.abs(dish[i] - time[i]) > max) {
               max = Math.abs(dish[i] - time[i]); 
           }
           
           total += dish[i];
       }
       System.out.println(total - max);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] time = new int[5]; time new int[5] 5 for(int i = 0; i < 5; ++i){
           time[i] = sc.nextInt();
       } int i = 0; int i = 0; i 0 i < 5 i 5 ++i ++i i {
           time[i] = sc.nextInt();
       } {
           time[i] = sc.nextInt();
       } time[i] = sc.nextInt() time[i] time i sc.nextInt() sc.nextInt sc int dish[] = new int[5]; dish new int[5] 5 for(int i = 0; i < 5; ++i){
           if(time[i]%10==0){
               dish[i] = (time[i]/10)*10;
           }else{
               dish[i] = (time[i]/10)*10 +10;
           }
       } int i = 0; int i = 0; i 0 i < 5 i 5 ++i ++i i {
           if(time[i]%10==0){
               dish[i] = (time[i]/10)*10;
           }else{
               dish[i] = (time[i]/10)*10 +10;
           }
       } {
           if(time[i]%10==0){
               dish[i] = (time[i]/10)*10;
           }else{
               dish[i] = (time[i]/10)*10 +10;
           }
       } if(time[i]%10==0){
               dish[i] = (time[i]/10)*10;
           }else{
               dish[i] = (time[i]/10)*10 +10;
           } time[i]%10==0 time[i]%10 time[i] time i 10 0 {
               dish[i] = (time[i]/10)*10;
           } dish[i] = (time[i]/10)*10 dish[i] dish i (time[i]/10)*10 (time[i]/10) time[i] time i 10 10 {
               dish[i] = (time[i]/10)*10 +10;
           } dish[i] = (time[i]/10)*10 +10 dish[i] dish i (time[i]/10)*10 +10 (time[i]/10)*10 (time[i]/10) time[i] time i 10 10 10 int max = 0; max 0 int total = 0; total 0 for(int i = 0; i < 5; ++i) {
           if(Math.abs(dish[i] - time[i]) > max) {
               max = Math.abs(dish[i] - time[i]); 
           }
           
           total += dish[i];
       } int i = 0; int i = 0; i 0 i < 5 i 5 ++i ++i i {
           if(Math.abs(dish[i] - time[i]) > max) {
               max = Math.abs(dish[i] - time[i]); 
           }
           
           total += dish[i];
       } {
           if(Math.abs(dish[i] - time[i]) > max) {
               max = Math.abs(dish[i] - time[i]); 
           }
           
           total += dish[i];
       } if(Math.abs(dish[i] - time[i]) > max) {
               max = Math.abs(dish[i] - time[i]); 
           } Math.abs(dish[i] - time[i]) > max Math.abs(dish[i] - time[i]) Math.abs Math dish[i] - time[i] dish[i] dish i time[i] time i max {
               max = Math.abs(dish[i] - time[i]); 
           } max = Math.abs(dish[i] - time[i]) max Math.abs(dish[i] - time[i]) Math.abs Math dish[i] - time[i] dish[i] dish i time[i] time i total += dish[i] total dish[i] dish i System.out.println(total - max) System.out.println System.out System System.out total - max total max String args[] args public class Main {
    public static void main(String args[]) {
       //値の取得
       Scanner sc = new Scanner(System.in);
       int[] time = new int[5];
       for(int i = 0; i < 5; ++i){
           time[i] = sc.nextInt();
       }
       
       int dish[] = new int[5];
       
       for(int i = 0; i < 5; ++i){
           if(time[i]%10==0){
               dish[i] = (time[i]/10)*10;
           }else{
               dish[i] = (time[i]/10)*10 +10;
           }
       }
       
       int max = 0;
       int total = 0; 
       for(int i = 0; i < 5; ++i) {
           if(Math.abs(dish[i] - time[i]) > max) {
               max = Math.abs(dish[i] - time[i]); 
           }
           
           total += dish[i];
       }
       System.out.println(total - max);
    }
} public class Main {
    public static void main(String args[]) {
       //値の取得
       Scanner sc = new Scanner(System.in);
       int[] time = new int[5];
       for(int i = 0; i < 5; ++i){
           time[i] = sc.nextInt();
       }
       
       int dish[] = new int[5];
       
       for(int i = 0; i < 5; ++i){
           if(time[i]%10==0){
               dish[i] = (time[i]/10)*10;
           }else{
               dish[i] = (time[i]/10)*10 +10;
           }
       }
       
       int max = 0;
       int total = 0; 
       for(int i = 0; i < 5; ++i) {
           if(Math.abs(dish[i] - time[i]) > max) {
               max = Math.abs(dish[i] - time[i]); 
           }
           
           total += dish[i];
       }
       System.out.println(total - max);
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String args[]) {
       //値の取得
       Scanner sc = new Scanner(System.in);
       int[] time = new int[5];
       for(int i = 0; i < 5; ++i){
           time[i] = sc.nextInt();
       }
       
       int dish[] = new int[5];
       
       for(int i = 0; i < 5; ++i){
           if(time[i]%10==0){
               dish[i] = (time[i]/10)*10;
           }else{
               dish[i] = (time[i]/10)*10 +10;
           }
       }
       
       int max = 0;
       int total = 0; 
       for(int i = 0; i < 5; ++i) {
           if(Math.abs(dish[i] - time[i]) > max) {
               max = Math.abs(dish[i] - time[i]); 
           }
           
           total += dish[i];
       }
       System.out.println(total - max);
    }
}