import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int[] menu = new int[5];
    for (int i=0; i<menu.length; i++) {
      menu[i] = sc.nextInt();
    }
    
    int max = 0;
    int flag = 0;
    for (int i=0; i<menu.length; i++) {
      int tmp = (int)(Math.ceil((double)menu[i]/10)*10);
      if (max < tmp-menu[i]) {
        flag = i;
        max = tmp-menu[i];
      }
    }
    
    int time = 0;
    for (int i=0; i<menu.length; i++) {
      if (i==flag) continue;
      
      time += (int)(Math.ceil((double)menu[i]/10)*10);
    }
    
    time += menu[flag];
    
    System.out.println(time);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int[] menu = new int[5];
    for (int i=0; i<menu.length; i++) {
      menu[i] = sc.nextInt();
    }
    
    int max = 0;
    int flag = 0;
    for (int i=0; i<menu.length; i++) {
      int tmp = (int)(Math.ceil((double)menu[i]/10)*10);
      if (max < tmp-menu[i]) {
        flag = i;
        max = tmp-menu[i];
      }
    }
    
    int time = 0;
    for (int i=0; i<menu.length; i++) {
      if (i==flag) continue;
      
      time += (int)(Math.ceil((double)menu[i]/10)*10);
    }
    
    time += menu[flag];
    
    System.out.println(time);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int[] menu = new int[5];
    for (int i=0; i<menu.length; i++) {
      menu[i] = sc.nextInt();
    }
    
    int max = 0;
    int flag = 0;
    for (int i=0; i<menu.length; i++) {
      int tmp = (int)(Math.ceil((double)menu[i]/10)*10);
      if (max < tmp-menu[i]) {
        flag = i;
        max = tmp-menu[i];
      }
    }
    
    int time = 0;
    for (int i=0; i<menu.length; i++) {
      if (i==flag) continue;
      
      time += (int)(Math.ceil((double)menu[i]/10)*10);
    }
    
    time += menu[flag];
    
    System.out.println(time);
  } main {
    Scanner sc = new Scanner(System.in);
    
    int[] menu = new int[5];
    for (int i=0; i<menu.length; i++) {
      menu[i] = sc.nextInt();
    }
    
    int max = 0;
    int flag = 0;
    for (int i=0; i<menu.length; i++) {
      int tmp = (int)(Math.ceil((double)menu[i]/10)*10);
      if (max < tmp-menu[i]) {
        flag = i;
        max = tmp-menu[i];
      }
    }
    
    int time = 0;
    for (int i=0; i<menu.length; i++) {
      if (i==flag) continue;
      
      time += (int)(Math.ceil((double)menu[i]/10)*10);
    }
    
    time += menu[flag];
    
    System.out.println(time);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] menu = new int[5]; menu new int[5] 5 for (int i=0; i<menu.length; i++) {
      menu[i] = sc.nextInt();
    } int i=0; int i=0; i 0 i<menu.length i menu.length menu menu.length i++ i++ i {
      menu[i] = sc.nextInt();
    } {
      menu[i] = sc.nextInt();
    } menu[i] = sc.nextInt() menu[i] menu i sc.nextInt() sc.nextInt sc int max = 0; max 0 int flag = 0; flag 0 for (int i=0; i<menu.length; i++) {
      int tmp = (int)(Math.ceil((double)menu[i]/10)*10);
      if (max < tmp-menu[i]) {
        flag = i;
        max = tmp-menu[i];
      }
    } int i=0; int i=0; i 0 i<menu.length i menu.length menu menu.length i++ i++ i {
      int tmp = (int)(Math.ceil((double)menu[i]/10)*10);
      if (max < tmp-menu[i]) {
        flag = i;
        max = tmp-menu[i];
      }
    } {
      int tmp = (int)(Math.ceil((double)menu[i]/10)*10);
      if (max < tmp-menu[i]) {
        flag = i;
        max = tmp-menu[i];
      }
    } int tmp = (int)(Math.ceil((double)menu[i]/10)*10); tmp (int)(Math.ceil((double)menu[i]/10)*10) Math.ceil((double)menu[i]/10) Math.ceil Math (double)menu[i]/10 (double)menu[i] menu i 10 10 if (max < tmp-menu[i]) {
        flag = i;
        max = tmp-menu[i];
      } max < tmp-menu[i] max tmp-menu[i] tmp menu[i] menu i {
        flag = i;
        max = tmp-menu[i];
      } flag = i flag i max = tmp-menu[i] max tmp-menu[i] tmp menu[i] menu i int time = 0; time 0 for (int i=0; i<menu.length; i++) {
      if (i==flag) continue;
      
      time += (int)(Math.ceil((double)menu[i]/10)*10);
    } int i=0; int i=0; i 0 i<menu.length i menu.length menu menu.length i++ i++ i {
      if (i==flag) continue;
      
      time += (int)(Math.ceil((double)menu[i]/10)*10);
    } {
      if (i==flag) continue;
      
      time += (int)(Math.ceil((double)menu[i]/10)*10);
    } if (i==flag) continue; i==flag i flag continue; time += (int)(Math.ceil((double)menu[i]/10)*10) time (int)(Math.ceil((double)menu[i]/10)*10) Math.ceil((double)menu[i]/10) Math.ceil Math (double)menu[i]/10 (double)menu[i] menu i 10 10 time += menu[flag] time menu[flag] menu flag System.out.println(time) System.out.println System.out System System.out time String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int[] menu = new int[5];
    for (int i=0; i<menu.length; i++) {
      menu[i] = sc.nextInt();
    }
    
    int max = 0;
    int flag = 0;
    for (int i=0; i<menu.length; i++) {
      int tmp = (int)(Math.ceil((double)menu[i]/10)*10);
      if (max < tmp-menu[i]) {
        flag = i;
        max = tmp-menu[i];
      }
    }
    
    int time = 0;
    for (int i=0; i<menu.length; i++) {
      if (i==flag) continue;
      
      time += (int)(Math.ceil((double)menu[i]/10)*10);
    }
    
    time += menu[flag];
    
    System.out.println(time);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int[] menu = new int[5];
    for (int i=0; i<menu.length; i++) {
      menu[i] = sc.nextInt();
    }
    
    int max = 0;
    int flag = 0;
    for (int i=0; i<menu.length; i++) {
      int tmp = (int)(Math.ceil((double)menu[i]/10)*10);
      if (max < tmp-menu[i]) {
        flag = i;
        max = tmp-menu[i];
      }
    }
    
    int time = 0;
    for (int i=0; i<menu.length; i++) {
      if (i==flag) continue;
      
      time += (int)(Math.ceil((double)menu[i]/10)*10);
    }
    
    time += menu[flag];
    
    System.out.println(time);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int[] menu = new int[5];
    for (int i=0; i<menu.length; i++) {
      menu[i] = sc.nextInt();
    }
    
    int max = 0;
    int flag = 0;
    for (int i=0; i<menu.length; i++) {
      int tmp = (int)(Math.ceil((double)menu[i]/10)*10);
      if (max < tmp-menu[i]) {
        flag = i;
        max = tmp-menu[i];
      }
    }
    
    int time = 0;
    for (int i=0; i<menu.length; i++) {
      if (i==flag) continue;
      
      time += (int)(Math.ceil((double)menu[i]/10)*10);
    }
    
    time += menu[flag];
    
    System.out.println(time);
  }
}
