import java.util.*;
class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int tempInt = 0;
      int sum = 0;
      int div=0;
      int min=10;
      for(int i = 0;i<5;i++){
        tempInt = sc.nextInt();
        div = tempInt%10;
        if(div==0){
          sum+= tempInt;
        }else{
          sum+= (int)(tempInt/10)*10+10;
          if(div<min)
            min=div;
        }
      }
      System.out.println(sum-10+min);
    }
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int tempInt = 0;
      int sum = 0;
      int div=0;
      int min=10;
      for(int i = 0;i<5;i++){
        tempInt = sc.nextInt();
        div = tempInt%10;
        if(div==0){
          sum+= tempInt;
        }else{
          sum+= (int)(tempInt/10)*10+10;
          if(div<min)
            min=div;
        }
      }
      System.out.println(sum-10+min);
    }
} Main public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int tempInt = 0;
      int sum = 0;
      int div=0;
      int min=10;
      for(int i = 0;i<5;i++){
        tempInt = sc.nextInt();
        div = tempInt%10;
        if(div==0){
          sum+= tempInt;
        }else{
          sum+= (int)(tempInt/10)*10+10;
          if(div<min)
            min=div;
        }
      }
      System.out.println(sum-10+min);
    } main {
      Scanner sc = new Scanner(System.in);
      int tempInt = 0;
      int sum = 0;
      int div=0;
      int min=10;
      for(int i = 0;i<5;i++){
        tempInt = sc.nextInt();
        div = tempInt%10;
        if(div==0){
          sum+= tempInt;
        }else{
          sum+= (int)(tempInt/10)*10+10;
          if(div<min)
            min=div;
        }
      }
      System.out.println(sum-10+min);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int tempInt = 0; tempInt 0 int sum = 0; sum 0 int div=0; div 0 int min=10; min 10 for(int i = 0;i<5;i++){
        tempInt = sc.nextInt();
        div = tempInt%10;
        if(div==0){
          sum+= tempInt;
        }else{
          sum+= (int)(tempInt/10)*10+10;
          if(div<min)
            min=div;
        }
      } int i = 0; int i = 0; i 0 i<5 i 5 i++ i++ i {
        tempInt = sc.nextInt();
        div = tempInt%10;
        if(div==0){
          sum+= tempInt;
        }else{
          sum+= (int)(tempInt/10)*10+10;
          if(div<min)
            min=div;
        }
      } {
        tempInt = sc.nextInt();
        div = tempInt%10;
        if(div==0){
          sum+= tempInt;
        }else{
          sum+= (int)(tempInt/10)*10+10;
          if(div<min)
            min=div;
        }
      } tempInt = sc.nextInt() tempInt sc.nextInt() sc.nextInt sc div = tempInt%10 div tempInt%10 tempInt 10 if(div==0){
          sum+= tempInt;
        }else{
          sum+= (int)(tempInt/10)*10+10;
          if(div<min)
            min=div;
        } div==0 div 0 {
          sum+= tempInt;
        } sum+= tempInt sum tempInt {
          sum+= (int)(tempInt/10)*10+10;
          if(div<min)
            min=div;
        } sum+= (int)(tempInt/10)*10+10 sum (int)(tempInt/10)*10+10 (int)(tempInt/10)*10 (int)(tempInt/10) tempInt 10 10 10 if(div<min)
            min=div; div<min div min min=div min div System.out.println(sum-10+min) System.out.println System.out System System.out sum-10+min sum-10 sum 10 min String[] args args
import java.util.*;
class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int tempInt = 0;
      int sum = 0;
      int div=0;
      int min=10;
      for(int i = 0;i<5;i++){
        tempInt = sc.nextInt();
        div = tempInt%10;
        if(div==0){
          sum+= tempInt;
        }else{
          sum+= (int)(tempInt/10)*10+10;
          if(div<min)
            min=div;
        }
      }
      System.out.println(sum-10+min);
    }
}