import java.util.*;

class Main{
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int min_n = -1, min_i = -1, sum = 0;
    int a[] = new int[5];
    for (int i = 0; i < 5; i++) {
      a[i] = sc.nextInt();
      if (i == 0 || a[i] % 10 < min_n && a[i] % 10 != 0) {
        min_n = a[i] % 10;
        min_i = i;
      }
    }
    for (int i = 0; i < 5; i++) {
      if (i == min_i) {
        sum += a[i];
      }
      else if (a[i] % 10 != 0){
        sum += a[i] + (10 - (a[i]%10));
      }
      else {
        sum += a[i];
      }
    }
    System.out.println(sum);
  }
} import java.util.*; util.* java class Main{
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int min_n = -1, min_i = -1, sum = 0;
    int a[] = new int[5];
    for (int i = 0; i < 5; i++) {
      a[i] = sc.nextInt();
      if (i == 0 || a[i] % 10 < min_n && a[i] % 10 != 0) {
        min_n = a[i] % 10;
        min_i = i;
      }
    }
    for (int i = 0; i < 5; i++) {
      if (i == min_i) {
        sum += a[i];
      }
      else if (a[i] % 10 != 0){
        sum += a[i] + (10 - (a[i]%10));
      }
      else {
        sum += a[i];
      }
    }
    System.out.println(sum);
  }
} Main public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int min_n = -1, min_i = -1, sum = 0;
    int a[] = new int[5];
    for (int i = 0; i < 5; i++) {
      a[i] = sc.nextInt();
      if (i == 0 || a[i] % 10 < min_n && a[i] % 10 != 0) {
        min_n = a[i] % 10;
        min_i = i;
      }
    }
    for (int i = 0; i < 5; i++) {
      if (i == min_i) {
        sum += a[i];
      }
      else if (a[i] % 10 != 0){
        sum += a[i] + (10 - (a[i]%10));
      }
      else {
        sum += a[i];
      }
    }
    System.out.println(sum);
  } main {
    Scanner sc = new Scanner(System.in);
    int min_n = -1, min_i = -1, sum = 0;
    int a[] = new int[5];
    for (int i = 0; i < 5; i++) {
      a[i] = sc.nextInt();
      if (i == 0 || a[i] % 10 < min_n && a[i] % 10 != 0) {
        min_n = a[i] % 10;
        min_i = i;
      }
    }
    for (int i = 0; i < 5; i++) {
      if (i == min_i) {
        sum += a[i];
      }
      else if (a[i] % 10 != 0){
        sum += a[i] + (10 - (a[i]%10));
      }
      else {
        sum += a[i];
      }
    }
    System.out.println(sum);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int min_n = -1 min_n -1 1 min_i = -1 min_i -1 1 sum = 0; sum 0 int a[] = new int[5]; a new int[5] 5 for (int i = 0; i < 5; i++) {
      a[i] = sc.nextInt();
      if (i == 0 || a[i] % 10 < min_n && a[i] % 10 != 0) {
        min_n = a[i] % 10;
        min_i = i;
      }
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
      a[i] = sc.nextInt();
      if (i == 0 || a[i] % 10 < min_n && a[i] % 10 != 0) {
        min_n = a[i] % 10;
        min_i = i;
      }
    } {
      a[i] = sc.nextInt();
      if (i == 0 || a[i] % 10 < min_n && a[i] % 10 != 0) {
        min_n = a[i] % 10;
        min_i = i;
      }
    } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if (i == 0 || a[i] % 10 < min_n && a[i] % 10 != 0) {
        min_n = a[i] % 10;
        min_i = i;
      } i == 0 || a[i] % 10 < min_n && a[i] % 10 != 0 i == 0 i 0 a[i] % 10 < min_n && a[i] % 10 != 0 a[i] % 10 < min_n a[i] % 10 a[i] a i 10 min_n a[i] % 10 != 0 a[i] % 10 a[i] a i 10 0 {
        min_n = a[i] % 10;
        min_i = i;
      } min_n = a[i] % 10 min_n a[i] % 10 a[i] a i 10 min_i = i min_i i for (int i = 0; i < 5; i++) {
      if (i == min_i) {
        sum += a[i];
      }
      else if (a[i] % 10 != 0){
        sum += a[i] + (10 - (a[i]%10));
      }
      else {
        sum += a[i];
      }
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
      if (i == min_i) {
        sum += a[i];
      }
      else if (a[i] % 10 != 0){
        sum += a[i] + (10 - (a[i]%10));
      }
      else {
        sum += a[i];
      }
    } {
      if (i == min_i) {
        sum += a[i];
      }
      else if (a[i] % 10 != 0){
        sum += a[i] + (10 - (a[i]%10));
      }
      else {
        sum += a[i];
      }
    } if (i == min_i) {
        sum += a[i];
      }
      else if (a[i] % 10 != 0){
        sum += a[i] + (10 - (a[i]%10));
      }
      else {
        sum += a[i];
      } i == min_i i min_i {
        sum += a[i];
      } sum += a[i] sum a[i] a i if (a[i] % 10 != 0){
        sum += a[i] + (10 - (a[i]%10));
      }
      else {
        sum += a[i];
      } a[i] % 10 != 0 a[i] % 10 a[i] a i 10 0 {
        sum += a[i] + (10 - (a[i]%10));
      } sum += a[i] + (10 - (a[i]%10)) sum a[i] + (10 - (a[i]%10)) a[i] a i (10 - (a[i]%10)) 10 (a[i]%10) a[i] a i 10 {
        sum += a[i];
      } sum += a[i] sum a[i] a i System.out.println(sum) System.out.println System.out System System.out sum String args[] args
import java.util.*;

class Main{
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int min_n = -1, min_i = -1, sum = 0;
    int a[] = new int[5];
    for (int i = 0; i < 5; i++) {
      a[i] = sc.nextInt();
      if (i == 0 || a[i] % 10 < min_n && a[i] % 10 != 0) {
        min_n = a[i] % 10;
        min_i = i;
      }
    }
    for (int i = 0; i < 5; i++) {
      if (i == min_i) {
        sum += a[i];
      }
      else if (a[i] % 10 != 0){
        sum += a[i] + (10 - (a[i]%10));
      }
      else {
        sum += a[i];
      }
    }
    System.out.println(sum);
  }
}
