import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.lang.Math;
import java.util.HashMap;
import java.util.Map;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] price = new int[5];
    for (int i = 0; i < 5; i++) {
      price[i] = Integer.parseInt(br.readLine());
    }
    
    int sum = 0;
    HashMap<Integer, Integer> tmp = new HashMap<Integer, Integer>();
    for (int i = 0; i < 5; i++) {
      if (price[i] % 10 == 0) {
        sum += price[i];
      } else {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      }
    }
    
    int max = 0;
    for (Map.Entry<Integer, Integer> entry : tmp.entrySet()) {
      max = Math.max(max, entry.getValue());
    }
    System.out.println(sum - max);
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io import java.lang.Math; Math java.lang import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] price = new int[5];
    for (int i = 0; i < 5; i++) {
      price[i] = Integer.parseInt(br.readLine());
    }
    
    int sum = 0;
    HashMap<Integer, Integer> tmp = new HashMap<Integer, Integer>();
    for (int i = 0; i < 5; i++) {
      if (price[i] % 10 == 0) {
        sum += price[i];
      } else {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      }
    }
    
    int max = 0;
    for (Map.Entry<Integer, Integer> entry : tmp.entrySet()) {
      max = Math.max(max, entry.getValue());
    }
    System.out.println(sum - max);
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] price = new int[5];
    for (int i = 0; i < 5; i++) {
      price[i] = Integer.parseInt(br.readLine());
    }
    
    int sum = 0;
    HashMap<Integer, Integer> tmp = new HashMap<Integer, Integer>();
    for (int i = 0; i < 5; i++) {
      if (price[i] % 10 == 0) {
        sum += price[i];
      } else {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      }
    }
    
    int max = 0;
    for (Map.Entry<Integer, Integer> entry : tmp.entrySet()) {
      max = Math.max(max, entry.getValue());
    }
    System.out.println(sum - max);
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] price = new int[5];
    for (int i = 0; i < 5; i++) {
      price[i] = Integer.parseInt(br.readLine());
    }
    
    int sum = 0;
    HashMap<Integer, Integer> tmp = new HashMap<Integer, Integer>();
    for (int i = 0; i < 5; i++) {
      if (price[i] % 10 == 0) {
        sum += price[i];
      } else {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      }
    }
    
    int max = 0;
    for (Map.Entry<Integer, Integer> entry : tmp.entrySet()) {
      max = Math.max(max, entry.getValue());
    }
    System.out.println(sum - max);
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int[] price = new int[5]; price new int[5] 5 for (int i = 0; i < 5; i++) {
      price[i] = Integer.parseInt(br.readLine());
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
      price[i] = Integer.parseInt(br.readLine());
    } {
      price[i] = Integer.parseInt(br.readLine());
    } price[i] = Integer.parseInt(br.readLine()) price[i] price i Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int sum = 0; sum 0 HashMap<Integer, Integer> tmp = new HashMap<Integer, Integer>(); tmp new HashMap<Integer, Integer>() for (int i = 0; i < 5; i++) {
      if (price[i] % 10 == 0) {
        sum += price[i];
      } else {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      }
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
      if (price[i] % 10 == 0) {
        sum += price[i];
      } else {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      }
    } {
      if (price[i] % 10 == 0) {
        sum += price[i];
      } else {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      }
    } if (price[i] % 10 == 0) {
        sum += price[i];
      } else {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      } price[i] % 10 == 0 price[i] % 10 price[i] price i 10 0 {
        sum += price[i];
      } sum += price[i] sum price[i] price i {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      } sum += price[i] + (10 - price[i] % 10) sum price[i] + (10 - price[i] % 10) price[i] price i (10 - price[i] % 10) 10 price[i] % 10 price[i] price i 10 tmp.put(i, 10 - price[i] % 10) tmp.put tmp i 10 - price[i] % 10 10 price[i] % 10 price[i] price i 10 int max = 0; max 0 for (Map.Entry<Integer, Integer> entry : tmp.entrySet()) {
      max = Math.max(max, entry.getValue());
    } Map.Entry<Integer, Integer> entry tmp.entrySet() tmp.entrySet tmp {
      max = Math.max(max, entry.getValue());
    } {
      max = Math.max(max, entry.getValue());
    } max = Math.max(max, entry.getValue()) max Math.max(max, entry.getValue()) Math.max Math max entry.getValue() entry.getValue entry System.out.println(sum - max) System.out.println System.out System System.out sum - max sum max String[] args args public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] price = new int[5];
    for (int i = 0; i < 5; i++) {
      price[i] = Integer.parseInt(br.readLine());
    }
    
    int sum = 0;
    HashMap<Integer, Integer> tmp = new HashMap<Integer, Integer>();
    for (int i = 0; i < 5; i++) {
      if (price[i] % 10 == 0) {
        sum += price[i];
      } else {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      }
    }
    
    int max = 0;
    for (Map.Entry<Integer, Integer> entry : tmp.entrySet()) {
      max = Math.max(max, entry.getValue());
    }
    System.out.println(sum - max);
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] price = new int[5];
    for (int i = 0; i < 5; i++) {
      price[i] = Integer.parseInt(br.readLine());
    }
    
    int sum = 0;
    HashMap<Integer, Integer> tmp = new HashMap<Integer, Integer>();
    for (int i = 0; i < 5; i++) {
      if (price[i] % 10 == 0) {
        sum += price[i];
      } else {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      }
    }
    
    int max = 0;
    for (Map.Entry<Integer, Integer> entry : tmp.entrySet()) {
      max = Math.max(max, entry.getValue());
    }
    System.out.println(sum - max);
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.lang.Math;
import java.util.HashMap;
import java.util.Map;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] price = new int[5];
    for (int i = 0; i < 5; i++) {
      price[i] = Integer.parseInt(br.readLine());
    }
    
    int sum = 0;
    HashMap<Integer, Integer> tmp = new HashMap<Integer, Integer>();
    for (int i = 0; i < 5; i++) {
      if (price[i] % 10 == 0) {
        sum += price[i];
      } else {
        sum += price[i] + (10 - price[i] % 10);
        tmp.put(i, 10 - price[i] % 10);
      }
    }
    
    int max = 0;
    for (Map.Entry<Integer, Integer> entry : tmp.entrySet()) {
      max = Math.max(max, entry.getValue());
    }
    System.out.println(sum - max);
  }
}