import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] menu = new int[5];
    for (int i = 0; i < 5; i++){
      menu[i] = Integer.parseInt(br.readLine());
    }
    int temp = 10;
    for (int i = 0; i < 4; i++){
      if (0 < menu[i]%10 && menu[i]%10 < temp){
        temp = menu[i]%10;
      }
    }
    int result = 0;
    for (int i = 0; i < 5; i++){
      result += new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue();
    }
    System.out.println(result -(10-temp));
  }
} import java.io.*; io.* java import java.math.BigDecimal; BigDecimal java.math import java.math.RoundingMode; RoundingMode java.math public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] menu = new int[5];
    for (int i = 0; i < 5; i++){
      menu[i] = Integer.parseInt(br.readLine());
    }
    int temp = 10;
    for (int i = 0; i < 4; i++){
      if (0 < menu[i]%10 && menu[i]%10 < temp){
        temp = menu[i]%10;
      }
    }
    int result = 0;
    for (int i = 0; i < 5; i++){
      result += new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue();
    }
    System.out.println(result -(10-temp));
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] menu = new int[5];
    for (int i = 0; i < 5; i++){
      menu[i] = Integer.parseInt(br.readLine());
    }
    int temp = 10;
    for (int i = 0; i < 4; i++){
      if (0 < menu[i]%10 && menu[i]%10 < temp){
        temp = menu[i]%10;
      }
    }
    int result = 0;
    for (int i = 0; i < 5; i++){
      result += new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue();
    }
    System.out.println(result -(10-temp));
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] menu = new int[5];
    for (int i = 0; i < 5; i++){
      menu[i] = Integer.parseInt(br.readLine());
    }
    int temp = 10;
    for (int i = 0; i < 4; i++){
      if (0 < menu[i]%10 && menu[i]%10 < temp){
        temp = menu[i]%10;
      }
    }
    int result = 0;
    for (int i = 0; i < 5; i++){
      result += new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue();
    }
    System.out.println(result -(10-temp));
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int[] menu = new int[5]; menu new int[5] 5 for (int i = 0; i < 5; i++){
      menu[i] = Integer.parseInt(br.readLine());
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
      menu[i] = Integer.parseInt(br.readLine());
    } {
      menu[i] = Integer.parseInt(br.readLine());
    } menu[i] = Integer.parseInt(br.readLine()) menu[i] menu i Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int temp = 10; temp 10 for (int i = 0; i < 4; i++){
      if (0 < menu[i]%10 && menu[i]%10 < temp){
        temp = menu[i]%10;
      }
    } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
      if (0 < menu[i]%10 && menu[i]%10 < temp){
        temp = menu[i]%10;
      }
    } {
      if (0 < menu[i]%10 && menu[i]%10 < temp){
        temp = menu[i]%10;
      }
    } if (0 < menu[i]%10 && menu[i]%10 < temp){
        temp = menu[i]%10;
      } 0 < menu[i]%10 && menu[i]%10 < temp 0 < menu[i]%10 0 menu[i]%10 menu[i] menu i 10 menu[i]%10 < temp menu[i]%10 menu[i] menu i 10 temp {
        temp = menu[i]%10;
      } temp = menu[i]%10 temp menu[i]%10 menu[i] menu i 10 int result = 0; result 0 for (int i = 0; i < 5; i++){
      result += new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue();
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
      result += new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue();
    } {
      result += new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue();
    } result += new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue() result new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue() new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP) new BigDecimal(menu[i]).setScale new BigDecimal(menu[i]) -1 1 RoundingMode.UP RoundingMode RoundingMode.UP System.out.println(result -(10-temp)) System.out.println System.out System System.out result -(10-temp) result (10-temp) 10 temp String[] args args public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] menu = new int[5];
    for (int i = 0; i < 5; i++){
      menu[i] = Integer.parseInt(br.readLine());
    }
    int temp = 10;
    for (int i = 0; i < 4; i++){
      if (0 < menu[i]%10 && menu[i]%10 < temp){
        temp = menu[i]%10;
      }
    }
    int result = 0;
    for (int i = 0; i < 5; i++){
      result += new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue();
    }
    System.out.println(result -(10-temp));
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] menu = new int[5];
    for (int i = 0; i < 5; i++){
      menu[i] = Integer.parseInt(br.readLine());
    }
    int temp = 10;
    for (int i = 0; i < 4; i++){
      if (0 < menu[i]%10 && menu[i]%10 < temp){
        temp = menu[i]%10;
      }
    }
    int result = 0;
    for (int i = 0; i < 5; i++){
      result += new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue();
    }
    System.out.println(result -(10-temp));
  }
} Main
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[] menu = new int[5];
    for (int i = 0; i < 5; i++){
      menu[i] = Integer.parseInt(br.readLine());
    }
    int temp = 10;
    for (int i = 0; i < 4; i++){
      if (0 < menu[i]%10 && menu[i]%10 < temp){
        temp = menu[i]%10;
      }
    }
    int result = 0;
    for (int i = 0; i < 5; i++){
      result += new BigDecimal(menu[i]).setScale(-1, RoundingMode.UP).intValue();
    }
    System.out.println(result -(10-temp));
  }
}
