import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] input = new int[5];
    input[0] = sc.nextInt();
    input[1] = sc.nextInt();
    input[2] = sc.nextInt();
    input[3] = sc.nextInt();
    input[4] = sc.nextInt();
    int lastIdx = 0;
    int answer = 0;
    for (int i = 1; i < 5; i++){
        if (input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10) {
            lastIdx = i;
        }
    }
    for (int i = 0; i < 5; i++){
        if (i != lastIdx) {
            answer += floor(input[i],10);
        }
    }
    answer += input[lastIdx];
    System.out.println(answer);

  }
  
  private static int floor(int src, int unit){
      if ((src % unit) == 0) {
          return src;
      } else {
          return ((src / unit) + 1) * unit;
      }
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] input = new int[5];
    input[0] = sc.nextInt();
    input[1] = sc.nextInt();
    input[2] = sc.nextInt();
    input[3] = sc.nextInt();
    input[4] = sc.nextInt();
    int lastIdx = 0;
    int answer = 0;
    for (int i = 1; i < 5; i++){
        if (input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10) {
            lastIdx = i;
        }
    }
    for (int i = 0; i < 5; i++){
        if (i != lastIdx) {
            answer += floor(input[i],10);
        }
    }
    answer += input[lastIdx];
    System.out.println(answer);

  }
  
  private static int floor(int src, int unit){
      if ((src % unit) == 0) {
          return src;
      } else {
          return ((src / unit) + 1) * unit;
      }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] input = new int[5];
    input[0] = sc.nextInt();
    input[1] = sc.nextInt();
    input[2] = sc.nextInt();
    input[3] = sc.nextInt();
    input[4] = sc.nextInt();
    int lastIdx = 0;
    int answer = 0;
    for (int i = 1; i < 5; i++){
        if (input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10) {
            lastIdx = i;
        }
    }
    for (int i = 0; i < 5; i++){
        if (i != lastIdx) {
            answer += floor(input[i],10);
        }
    }
    answer += input[lastIdx];
    System.out.println(answer);

  } main {
    Scanner sc = new Scanner(System.in);
    int[] input = new int[5];
    input[0] = sc.nextInt();
    input[1] = sc.nextInt();
    input[2] = sc.nextInt();
    input[3] = sc.nextInt();
    input[4] = sc.nextInt();
    int lastIdx = 0;
    int answer = 0;
    for (int i = 1; i < 5; i++){
        if (input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10) {
            lastIdx = i;
        }
    }
    for (int i = 0; i < 5; i++){
        if (i != lastIdx) {
            answer += floor(input[i],10);
        }
    }
    answer += input[lastIdx];
    System.out.println(answer);

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] input = new int[5]; input new int[5] 5 input[0] = sc.nextInt() input[0] input 0 sc.nextInt() sc.nextInt sc input[1] = sc.nextInt() input[1] input 1 sc.nextInt() sc.nextInt sc input[2] = sc.nextInt() input[2] input 2 sc.nextInt() sc.nextInt sc input[3] = sc.nextInt() input[3] input 3 sc.nextInt() sc.nextInt sc input[4] = sc.nextInt() input[4] input 4 sc.nextInt() sc.nextInt sc int lastIdx = 0; lastIdx 0 int answer = 0; answer 0 for (int i = 1; i < 5; i++){
        if (input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10) {
            lastIdx = i;
        }
    } int i = 1; int i = 1; i 1 i < 5 i 5 i++ i++ i {
        if (input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10) {
            lastIdx = i;
        }
    } {
        if (input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10) {
            lastIdx = i;
        }
    } if (input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10) {
            lastIdx = i;
        } input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10 input[i] % 10 != 0 input[i] % 10 input[i] input i 10 0 input[lastIdx] % 10 > input[i] % 10 input[lastIdx] % 10 input[lastIdx] input lastIdx 10 input[i] % 10 input[i] input i 10 {
            lastIdx = i;
        } lastIdx = i lastIdx i for (int i = 0; i < 5; i++){
        if (i != lastIdx) {
            answer += floor(input[i],10);
        }
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
        if (i != lastIdx) {
            answer += floor(input[i],10);
        }
    } {
        if (i != lastIdx) {
            answer += floor(input[i],10);
        }
    } if (i != lastIdx) {
            answer += floor(input[i],10);
        } i != lastIdx i lastIdx {
            answer += floor(input[i],10);
        } answer += floor(input[i],10) answer floor(input[i],10) floor input[i] input i 10 answer += input[lastIdx] answer input[lastIdx] input lastIdx System.out.println(answer) System.out.println System.out System System.out answer String[] args args private static int floor(int src, int unit){
      if ((src % unit) == 0) {
          return src;
      } else {
          return ((src / unit) + 1) * unit;
      }
  } floor {
      if ((src % unit) == 0) {
          return src;
      } else {
          return ((src / unit) + 1) * unit;
      }
  } if ((src % unit) == 0) {
          return src;
      } else {
          return ((src / unit) + 1) * unit;
      } (src % unit) == 0 (src % unit) src unit 0 {
          return src;
      } return src; src {
          return ((src / unit) + 1) * unit;
      } return ((src / unit) + 1) * unit; ((src / unit) + 1) * unit ((src / unit) + 1) (src / unit) src unit 1 unit int src src int unit unit public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] input = new int[5];
    input[0] = sc.nextInt();
    input[1] = sc.nextInt();
    input[2] = sc.nextInt();
    input[3] = sc.nextInt();
    input[4] = sc.nextInt();
    int lastIdx = 0;
    int answer = 0;
    for (int i = 1; i < 5; i++){
        if (input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10) {
            lastIdx = i;
        }
    }
    for (int i = 0; i < 5; i++){
        if (i != lastIdx) {
            answer += floor(input[i],10);
        }
    }
    answer += input[lastIdx];
    System.out.println(answer);

  }
  
  private static int floor(int src, int unit){
      if ((src % unit) == 0) {
          return src;
      } else {
          return ((src / unit) + 1) * unit;
      }
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] input = new int[5];
    input[0] = sc.nextInt();
    input[1] = sc.nextInt();
    input[2] = sc.nextInt();
    input[3] = sc.nextInt();
    input[4] = sc.nextInt();
    int lastIdx = 0;
    int answer = 0;
    for (int i = 1; i < 5; i++){
        if (input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10) {
            lastIdx = i;
        }
    }
    for (int i = 0; i < 5; i++){
        if (i != lastIdx) {
            answer += floor(input[i],10);
        }
    }
    answer += input[lastIdx];
    System.out.println(answer);

  }
  
  private static int floor(int src, int unit){
      if ((src % unit) == 0) {
          return src;
      } else {
          return ((src / unit) + 1) * unit;
      }
  }
} Main
import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] input = new int[5];
    input[0] = sc.nextInt();
    input[1] = sc.nextInt();
    input[2] = sc.nextInt();
    input[3] = sc.nextInt();
    input[4] = sc.nextInt();
    int lastIdx = 0;
    int answer = 0;
    for (int i = 1; i < 5; i++){
        if (input[i] % 10 != 0 && input[lastIdx] % 10 > input[i] % 10) {
            lastIdx = i;
        }
    }
    for (int i = 0; i < 5; i++){
        if (i != lastIdx) {
            answer += floor(input[i],10);
        }
    }
    answer += input[lastIdx];
    System.out.println(answer);

  }
  
  private static int floor(int src, int unit){
      if ((src % unit) == 0) {
          return src;
      } else {
          return ((src / unit) + 1) * unit;
      }
  }
}
