import java.util.*;
public class Main{
  public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    int e = sc.nextInt();
    int mindex = 0;
    int sum = 0;
    int[] alist = {a,b,c,d,e};
	int slist[] = new int[5];
    
    for(int i = 0;i < 5;i++){
            if(alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0){
              mindex = i;
            }
    }
    
    for(int i = 0;i < 5;i++){
      if(i == mindex || alist[i] % 10 == 0){
        sum+= alist[i];
      }else{
       	sum+= alist[i] / 10 * 10 +10; 
      }
    }
    
    System.out.println(sum);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    int e = sc.nextInt();
    int mindex = 0;
    int sum = 0;
    int[] alist = {a,b,c,d,e};
	int slist[] = new int[5];
    
    for(int i = 0;i < 5;i++){
            if(alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0){
              mindex = i;
            }
    }
    
    for(int i = 0;i < 5;i++){
      if(i == mindex || alist[i] % 10 == 0){
        sum+= alist[i];
      }else{
       	sum+= alist[i] / 10 * 10 +10; 
      }
    }
    
    System.out.println(sum);
  }
} Main public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    int e = sc.nextInt();
    int mindex = 0;
    int sum = 0;
    int[] alist = {a,b,c,d,e};
	int slist[] = new int[5];
    
    for(int i = 0;i < 5;i++){
            if(alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0){
              mindex = i;
            }
    }
    
    for(int i = 0;i < 5;i++){
      if(i == mindex || alist[i] % 10 == 0){
        sum+= alist[i];
      }else{
       	sum+= alist[i] / 10 * 10 +10; 
      }
    }
    
    System.out.println(sum);
  } main {
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    int e = sc.nextInt();
    int mindex = 0;
    int sum = 0;
    int[] alist = {a,b,c,d,e};
	int slist[] = new int[5];
    
    for(int i = 0;i < 5;i++){
            if(alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0){
              mindex = i;
            }
    }
    
    for(int i = 0;i < 5;i++){
      if(i == mindex || alist[i] % 10 == 0){
        sum+= alist[i];
      }else{
       	sum+= alist[i] / 10 * 10 +10; 
      }
    }
    
    System.out.println(sum);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc int e = sc.nextInt(); e sc.nextInt() sc.nextInt sc int mindex = 0; mindex 0 int sum = 0; sum 0 int[] alist = {a,b,c,d,e}; alist {a,b,c,d,e} a b c d e int slist[] = new int[5]; slist new int[5] 5 for(int i = 0;i < 5;i++){
            if(alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0){
              mindex = i;
            }
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if(alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0){
              mindex = i;
            }
    } {
            if(alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0){
              mindex = i;
            }
    } if(alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0){
              mindex = i;
            } alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0 alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 alist[mindex] % 10 > alist[i] % 10 alist[mindex] % 10 alist[mindex] alist mindex 10 alist[i] % 10 alist[i] alist i 10 alist[i] % 10 != 0 alist[i] % 10 alist[i] alist i 10 0 alist[mindex] % 10 == 0 alist[mindex] % 10 alist[mindex] alist mindex 10 0 {
              mindex = i;
            } mindex = i mindex i for(int i = 0;i < 5;i++){
      if(i == mindex || alist[i] % 10 == 0){
        sum+= alist[i];
      }else{
       	sum+= alist[i] / 10 * 10 +10; 
      }
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
      if(i == mindex || alist[i] % 10 == 0){
        sum+= alist[i];
      }else{
       	sum+= alist[i] / 10 * 10 +10; 
      }
    } {
      if(i == mindex || alist[i] % 10 == 0){
        sum+= alist[i];
      }else{
       	sum+= alist[i] / 10 * 10 +10; 
      }
    } if(i == mindex || alist[i] % 10 == 0){
        sum+= alist[i];
      }else{
       	sum+= alist[i] / 10 * 10 +10; 
      } i == mindex || alist[i] % 10 == 0 i == mindex i mindex alist[i] % 10 == 0 alist[i] % 10 alist[i] alist i 10 0 {
        sum+= alist[i];
      } sum+= alist[i] sum alist[i] alist i {
       	sum+= alist[i] / 10 * 10 +10; 
      } sum+= alist[i] / 10 * 10 +10 sum alist[i] / 10 * 10 +10 alist[i] / 10 * 10 alist[i] / 10 alist[i] alist i 10 10 10 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main{
  public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    int e = sc.nextInt();
    int mindex = 0;
    int sum = 0;
    int[] alist = {a,b,c,d,e};
	int slist[] = new int[5];
    
    for(int i = 0;i < 5;i++){
            if(alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0){
              mindex = i;
            }
    }
    
    for(int i = 0;i < 5;i++){
      if(i == mindex || alist[i] % 10 == 0){
        sum+= alist[i];
      }else{
       	sum+= alist[i] / 10 * 10 +10; 
      }
    }
    
    System.out.println(sum);
  }
} public class Main{
  public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    int e = sc.nextInt();
    int mindex = 0;
    int sum = 0;
    int[] alist = {a,b,c,d,e};
	int slist[] = new int[5];
    
    for(int i = 0;i < 5;i++){
            if(alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0){
              mindex = i;
            }
    }
    
    for(int i = 0;i < 5;i++){
      if(i == mindex || alist[i] % 10 == 0){
        sum+= alist[i];
      }else{
       	sum+= alist[i] / 10 * 10 +10; 
      }
    }
    
    System.out.println(sum);
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    int e = sc.nextInt();
    int mindex = 0;
    int sum = 0;
    int[] alist = {a,b,c,d,e};
	int slist[] = new int[5];
    
    for(int i = 0;i < 5;i++){
            if(alist[mindex] % 10 > alist[i] % 10 && alist[i] % 10 != 0 || alist[mindex] % 10 == 0){
              mindex = i;
            }
    }
    
    for(int i = 0;i < 5;i++){
      if(i == mindex || alist[i] % 10 == 0){
        sum+= alist[i];
      }else{
       	sum+= alist[i] / 10 * 10 +10; 
      }
    }
    
    System.out.println(sum);
  }
}