import java.util.Scanner;

class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int[] time = new int[5];
    for (int i = 0; i < 5; i++) {
      time[i] = scanner.nextInt();
    }
    int minIdx = 0;
    int minMod = (time[0] - 1) % 10;
    for (int i = 1; i < 5; i++) {
      if ((time[i] - 1) % 10 < minMod) {
        minIdx = i;
        minMod = (time[i] - 1) % 10;
      }
    }
    int sum = 0;
    for (int i = 0; i < 5; i++) {
      if (i != minIdx) {
        sum += (time[i] + 9) / 10 * 10;
      }
    }
    sum += time[minIdx];
    System.out.println(sum);
  }

} import java.util.Scanner; Scanner java.util class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int[] time = new int[5];
    for (int i = 0; i < 5; i++) {
      time[i] = scanner.nextInt();
    }
    int minIdx = 0;
    int minMod = (time[0] - 1) % 10;
    for (int i = 1; i < 5; i++) {
      if ((time[i] - 1) % 10 < minMod) {
        minIdx = i;
        minMod = (time[i] - 1) % 10;
      }
    }
    int sum = 0;
    for (int i = 0; i < 5; i++) {
      if (i != minIdx) {
        sum += (time[i] + 9) / 10 * 10;
      }
    }
    sum += time[minIdx];
    System.out.println(sum);
  }

} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int[] time = new int[5];
    for (int i = 0; i < 5; i++) {
      time[i] = scanner.nextInt();
    }
    int minIdx = 0;
    int minMod = (time[0] - 1) % 10;
    for (int i = 1; i < 5; i++) {
      if ((time[i] - 1) % 10 < minMod) {
        minIdx = i;
        minMod = (time[i] - 1) % 10;
      }
    }
    int sum = 0;
    for (int i = 0; i < 5; i++) {
      if (i != minIdx) {
        sum += (time[i] + 9) / 10 * 10;
      }
    }
    sum += time[minIdx];
    System.out.println(sum);
  } main {
    Scanner scanner = new Scanner(System.in);
    int[] time = new int[5];
    for (int i = 0; i < 5; i++) {
      time[i] = scanner.nextInt();
    }
    int minIdx = 0;
    int minMod = (time[0] - 1) % 10;
    for (int i = 1; i < 5; i++) {
      if ((time[i] - 1) % 10 < minMod) {
        minIdx = i;
        minMod = (time[i] - 1) % 10;
      }
    }
    int sum = 0;
    for (int i = 0; i < 5; i++) {
      if (i != minIdx) {
        sum += (time[i] + 9) / 10 * 10;
      }
    }
    sum += time[minIdx];
    System.out.println(sum);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[] time = new int[5]; time new int[5] 5 for (int i = 0; i < 5; i++) {
      time[i] = scanner.nextInt();
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
      time[i] = scanner.nextInt();
    } {
      time[i] = scanner.nextInt();
    } time[i] = scanner.nextInt() time[i] time i scanner.nextInt() scanner.nextInt scanner int minIdx = 0; minIdx 0 int minMod = (time[0] - 1) % 10; minMod (time[0] - 1) % 10 (time[0] - 1) time[0] time 0 1 10 for (int i = 1; i < 5; i++) {
      if ((time[i] - 1) % 10 < minMod) {
        minIdx = i;
        minMod = (time[i] - 1) % 10;
      }
    } int i = 1; int i = 1; i 1 i < 5 i 5 i++ i++ i {
      if ((time[i] - 1) % 10 < minMod) {
        minIdx = i;
        minMod = (time[i] - 1) % 10;
      }
    } {
      if ((time[i] - 1) % 10 < minMod) {
        minIdx = i;
        minMod = (time[i] - 1) % 10;
      }
    } if ((time[i] - 1) % 10 < minMod) {
        minIdx = i;
        minMod = (time[i] - 1) % 10;
      } (time[i] - 1) % 10 < minMod (time[i] - 1) % 10 (time[i] - 1) time[i] time i 1 10 minMod {
        minIdx = i;
        minMod = (time[i] - 1) % 10;
      } minIdx = i minIdx i minMod = (time[i] - 1) % 10 minMod (time[i] - 1) % 10 (time[i] - 1) time[i] time i 1 10 int sum = 0; sum 0 for (int i = 0; i < 5; i++) {
      if (i != minIdx) {
        sum += (time[i] + 9) / 10 * 10;
      }
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
      if (i != minIdx) {
        sum += (time[i] + 9) / 10 * 10;
      }
    } {
      if (i != minIdx) {
        sum += (time[i] + 9) / 10 * 10;
      }
    } if (i != minIdx) {
        sum += (time[i] + 9) / 10 * 10;
      } i != minIdx i minIdx {
        sum += (time[i] + 9) / 10 * 10;
      } sum += (time[i] + 9) / 10 * 10 sum (time[i] + 9) / 10 * 10 (time[i] + 9) / 10 (time[i] + 9) time[i] time i 9 10 10 sum += time[minIdx] sum time[minIdx] time minIdx System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.Scanner;

class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int[] time = new int[5];
    for (int i = 0; i < 5; i++) {
      time[i] = scanner.nextInt();
    }
    int minIdx = 0;
    int minMod = (time[0] - 1) % 10;
    for (int i = 1; i < 5; i++) {
      if ((time[i] - 1) % 10 < minMod) {
        minIdx = i;
        minMod = (time[i] - 1) % 10;
      }
    }
    int sum = 0;
    for (int i = 0; i < 5; i++) {
      if (i != minIdx) {
        sum += (time[i] + 9) / 10 * 10;
      }
    }
    sum += time[minIdx];
    System.out.println(sum);
  }

}
