import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int Ds[]=new int[5];
    int result=0;
    int sa=10;
    Ds[0]=sc.nextInt();
    Ds[1]=sc.nextInt();
    Ds[2]=sc.nextInt();
    Ds[3]=sc.nextInt();
    Ds[4]=sc.nextInt();




    for(int k=0;k<5;k++){
      if(Ds[k]%10<sa&&!(Ds[k]%10==0)){
        sa=Ds[k]%10;
      }
    }
    for(int j=0;j<5;j++){
      if(Ds[j]%10==0){
        result+=Ds[j];
      }else{
        while(!(Ds[j]%10==0)){
          Ds[j]++;
        }
        result+=Ds[j];
      }
    }
    System.out.println(result-10+sa);
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int Ds[]=new int[5];
    int result=0;
    int sa=10;
    Ds[0]=sc.nextInt();
    Ds[1]=sc.nextInt();
    Ds[2]=sc.nextInt();
    Ds[3]=sc.nextInt();
    Ds[4]=sc.nextInt();




    for(int k=0;k<5;k++){
      if(Ds[k]%10<sa&&!(Ds[k]%10==0)){
        sa=Ds[k]%10;
      }
    }
    for(int j=0;j<5;j++){
      if(Ds[j]%10==0){
        result+=Ds[j];
      }else{
        while(!(Ds[j]%10==0)){
          Ds[j]++;
        }
        result+=Ds[j];
      }
    }
    System.out.println(result-10+sa);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int Ds[]=new int[5];
    int result=0;
    int sa=10;
    Ds[0]=sc.nextInt();
    Ds[1]=sc.nextInt();
    Ds[2]=sc.nextInt();
    Ds[3]=sc.nextInt();
    Ds[4]=sc.nextInt();




    for(int k=0;k<5;k++){
      if(Ds[k]%10<sa&&!(Ds[k]%10==0)){
        sa=Ds[k]%10;
      }
    }
    for(int j=0;j<5;j++){
      if(Ds[j]%10==0){
        result+=Ds[j];
      }else{
        while(!(Ds[j]%10==0)){
          Ds[j]++;
        }
        result+=Ds[j];
      }
    }
    System.out.println(result-10+sa);
  } main {
    Scanner sc = new Scanner(System.in);
    int Ds[]=new int[5];
    int result=0;
    int sa=10;
    Ds[0]=sc.nextInt();
    Ds[1]=sc.nextInt();
    Ds[2]=sc.nextInt();
    Ds[3]=sc.nextInt();
    Ds[4]=sc.nextInt();




    for(int k=0;k<5;k++){
      if(Ds[k]%10<sa&&!(Ds[k]%10==0)){
        sa=Ds[k]%10;
      }
    }
    for(int j=0;j<5;j++){
      if(Ds[j]%10==0){
        result+=Ds[j];
      }else{
        while(!(Ds[j]%10==0)){
          Ds[j]++;
        }
        result+=Ds[j];
      }
    }
    System.out.println(result-10+sa);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int Ds[]=new int[5]; Ds new int[5] 5 int result=0; result 0 int sa=10; sa 10 Ds[0]=sc.nextInt() Ds[0] Ds 0 sc.nextInt() sc.nextInt sc Ds[1]=sc.nextInt() Ds[1] Ds 1 sc.nextInt() sc.nextInt sc Ds[2]=sc.nextInt() Ds[2] Ds 2 sc.nextInt() sc.nextInt sc Ds[3]=sc.nextInt() Ds[3] Ds 3 sc.nextInt() sc.nextInt sc Ds[4]=sc.nextInt() Ds[4] Ds 4 sc.nextInt() sc.nextInt sc for(int k=0;k<5;k++){
      if(Ds[k]%10<sa&&!(Ds[k]%10==0)){
        sa=Ds[k]%10;
      }
    } int k=0; int k=0; k 0 k<5 k 5 k++ k++ k {
      if(Ds[k]%10<sa&&!(Ds[k]%10==0)){
        sa=Ds[k]%10;
      }
    } {
      if(Ds[k]%10<sa&&!(Ds[k]%10==0)){
        sa=Ds[k]%10;
      }
    } if(Ds[k]%10<sa&&!(Ds[k]%10==0)){
        sa=Ds[k]%10;
      } Ds[k]%10<sa&&!(Ds[k]%10==0) Ds[k]%10<sa Ds[k]%10 Ds[k] Ds k 10 sa !(Ds[k]%10==0) (Ds[k]%10==0) Ds[k]%10 Ds[k] Ds k 10 0 {
        sa=Ds[k]%10;
      } sa=Ds[k]%10 sa Ds[k]%10 Ds[k] Ds k 10 for(int j=0;j<5;j++){
      if(Ds[j]%10==0){
        result+=Ds[j];
      }else{
        while(!(Ds[j]%10==0)){
          Ds[j]++;
        }
        result+=Ds[j];
      }
    } int j=0; int j=0; j 0 j<5 j 5 j++ j++ j {
      if(Ds[j]%10==0){
        result+=Ds[j];
      }else{
        while(!(Ds[j]%10==0)){
          Ds[j]++;
        }
        result+=Ds[j];
      }
    } {
      if(Ds[j]%10==0){
        result+=Ds[j];
      }else{
        while(!(Ds[j]%10==0)){
          Ds[j]++;
        }
        result+=Ds[j];
      }
    } if(Ds[j]%10==0){
        result+=Ds[j];
      }else{
        while(!(Ds[j]%10==0)){
          Ds[j]++;
        }
        result+=Ds[j];
      } Ds[j]%10==0 Ds[j]%10 Ds[j] Ds j 10 0 {
        result+=Ds[j];
      } result+=Ds[j] result Ds[j] Ds j {
        while(!(Ds[j]%10==0)){
          Ds[j]++;
        }
        result+=Ds[j];
      } while(!(Ds[j]%10==0)){
          Ds[j]++;
        } !(Ds[j]%10==0) (Ds[j]%10==0) Ds[j]%10 Ds[j] Ds j 10 0 {
          Ds[j]++;
        } Ds[j]++ Ds[j] Ds j result+=Ds[j] result Ds[j] Ds j System.out.println(result-10+sa) System.out.println System.out System System.out result-10+sa result-10 result 10 sa String[] args args
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int Ds[]=new int[5];
    int result=0;
    int sa=10;
    Ds[0]=sc.nextInt();
    Ds[1]=sc.nextInt();
    Ds[2]=sc.nextInt();
    Ds[3]=sc.nextInt();
    Ds[4]=sc.nextInt();




    for(int k=0;k<5;k++){
      if(Ds[k]%10<sa&&!(Ds[k]%10==0)){
        sa=Ds[k]%10;
      }
    }
    for(int j=0;j<5;j++){
      if(Ds[j]%10==0){
        result+=Ds[j];
      }else{
        while(!(Ds[j]%10==0)){
          Ds[j]++;
        }
        result+=Ds[j];
      }
    }
    System.out.println(result-10+sa);
  }
}
