import java.util.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] num = new int[5];
    int t = 0;//入れ替え用
    int sum = 0;
    for(int i=0; i <= 4; i++){
    num[i] = sc.nextInt();
    if(i!=0){
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    }
  }

    for(int i=0; i <= 3; i++){
        if((num[i] % 10) == 0){
        sum += num[i];
        //System.out.println(num[i]);
    }else if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    }
    }
        sum = sum + num[4];
        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[] num = new int[5];
    int t = 0;//入れ替え用
    int sum = 0;
    for(int i=0; i <= 4; i++){
    num[i] = sc.nextInt();
    if(i!=0){
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    }
  }

    for(int i=0; i <= 3; i++){
        if((num[i] % 10) == 0){
        sum += num[i];
        //System.out.println(num[i]);
    }else if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    }
    }
        sum = sum + num[4];
        System.out.println(sum);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] num = new int[5];
    int t = 0;//入れ替え用
    int sum = 0;
    for(int i=0; i <= 4; i++){
    num[i] = sc.nextInt();
    if(i!=0){
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    }
  }

    for(int i=0; i <= 3; i++){
        if((num[i] % 10) == 0){
        sum += num[i];
        //System.out.println(num[i]);
    }else if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    }
    }
        sum = sum + num[4];
        System.out.println(sum);
  } main {
    Scanner sc = new Scanner(System.in);
    int[] num = new int[5];
    int t = 0;//入れ替え用
    int sum = 0;
    for(int i=0; i <= 4; i++){
    num[i] = sc.nextInt();
    if(i!=0){
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    }
  }

    for(int i=0; i <= 3; i++){
        if((num[i] % 10) == 0){
        sum += num[i];
        //System.out.println(num[i]);
    }else if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    }
    }
        sum = sum + num[4];
        System.out.println(sum);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] num = new int[5]; num new int[5] 5 int t = 0; t 0 int sum = 0; sum 0 for(int i=0; i <= 4; i++){
    num[i] = sc.nextInt();
    if(i!=0){
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    }
  } int i=0; int i=0; i 0 i <= 4 i 4 i++ i++ i {
    num[i] = sc.nextInt();
    if(i!=0){
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    }
  } {
    num[i] = sc.nextInt();
    if(i!=0){
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    }
  } num[i] = sc.nextInt() num[i] num i sc.nextInt() sc.nextInt sc if(i!=0){
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    } i!=0 i 0 {
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    } if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        } (num[i]%10)!=0 (num[i]%10) num[i] num i 10 0 {
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        } if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         } (num[i-1]%10) < (num[i]%10) (num[i-1]%10) num[i-1] num i-1 i 1 10 (num[i]%10) num[i] num i 10 {
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         } t = num[i-1] t num[i-1] num i-1 i 1 num[i-1] = num[i] num[i-1] num i-1 i 1 num[i] num i num[i] = t num[i] num i t if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        } (num[i]%10 == 0) num[i]%10 num[i] num i 10 0 {
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        } if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         } (num[i-1]%10) > (num[i]%10) (num[i-1]%10) num[i-1] num i-1 i 1 10 (num[i]%10) num[i] num i 10 {
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         } t = num[i-1] t num[i-1] num i-1 i 1 num[i-1] = num[i] num[i-1] num i-1 i 1 num[i] num i num[i] = t num[i] num i t for(int i=0; i <= 3; i++){
        if((num[i] % 10) == 0){
        sum += num[i];
        //System.out.println(num[i]);
    }else if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    }
    } int i=0; int i=0; i 0 i <= 3 i 3 i++ i++ i {
        if((num[i] % 10) == 0){
        sum += num[i];
        //System.out.println(num[i]);
    }else if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    }
    } {
        if((num[i] % 10) == 0){
        sum += num[i];
        //System.out.println(num[i]);
    }else if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    }
    } if((num[i] % 10) == 0){
        sum += num[i];
        //System.out.println(num[i]);
    }else if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    } (num[i] % 10) == 0 (num[i] % 10) num[i] num i 10 0 {
        sum += num[i];
        //System.out.println(num[i]);
    } sum += num[i] sum num[i] num i if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    } (num[i] % 10) != 0 (num[i] % 10) num[i] num i 10 0 {
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    } sum = sum + num[i] + (10 - num[i]%10) sum sum + num[i] + (10 - num[i]%10) sum + num[i] + (10 - num[i]%10) sum num[i] num i (10 - num[i]%10) 10 num[i]%10 num[i] num i 10 sum = sum + num[4] sum sum + num[4] sum num[4] num 4 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[] num = new int[5];
    int t = 0;//入れ替え用
    int sum = 0;
    for(int i=0; i <= 4; i++){
    num[i] = sc.nextInt();
    if(i!=0){
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    }
  }

    for(int i=0; i <= 3; i++){
        if((num[i] % 10) == 0){
        sum += num[i];
        //System.out.println(num[i]);
    }else if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    }
    }
        sum = sum + num[4];
        System.out.println(sum);
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] num = new int[5];
    int t = 0;//入れ替え用
    int sum = 0;
    for(int i=0; i <= 4; i++){
    num[i] = sc.nextInt();
    if(i!=0){
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    }
  }

    for(int i=0; i <= 3; i++){
        if((num[i] % 10) == 0){
        sum += num[i];
        //System.out.println(num[i]);
    }else if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    }
    }
        sum = sum + num[4];
        System.out.println(sum);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] num = new int[5];
    int t = 0;//入れ替え用
    int sum = 0;
    for(int i=0; i <= 4; i++){
    num[i] = sc.nextInt();
    if(i!=0){
        if((num[i]%10)!=0){
         if((num[i-1]%10) < (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }else if((num[i]%10 == 0)){
            if((num[i-1]%10) > (num[i]%10)){
            t = num[i-1];
            num[i-1] = num[i];
            num[i] = t;
         }
        }
    }
  }

    for(int i=0; i <= 3; i++){
        if((num[i] % 10) == 0){
        sum += num[i];
        //System.out.println(num[i]);
    }else if((num[i] % 10) != 0){
        sum = sum + num[i] + (10 - num[i]%10);
        //System.out.println(num[i]);
    }
    }
        sum = sum + num[4];
        System.out.println(sum);
  }
}