import java.util.*;

public class Main{
  static int[] ans;
  static Map<Integer, Integer> map;
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int E = Integer.parseInt(sc.next());
    
    int n = 10;
    if(A%10 != 0){
      n = n > A%10 ? A%10 : n;
      A = A+ 10-A%10;
    }
    if(B%10 != 0){
      n = n > B%10 ? B%10 : n;
      B = B+ 10-B%10;
    }
    if(C%10 != 0){
      n = n > C%10 ? C%10 : n;
      C = C+ 10-C%10;
    }
    if(D%10 != 0){
      n = n > D%10 ? D%10 : n;
      D = D+ 10-D%10;
    }
    if(E%10 != 0){
      n = n > E%10 ? E%10 : n;
      E = E+ 10-E%10;
    }
    
    n = 10-n;
    int ans = A+B+C+D+E-n;
    System.out.println(ans);
  }
} import java.util.*; util.* java public class Main{
  static int[] ans;
  static Map<Integer, Integer> map;
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int E = Integer.parseInt(sc.next());
    
    int n = 10;
    if(A%10 != 0){
      n = n > A%10 ? A%10 : n;
      A = A+ 10-A%10;
    }
    if(B%10 != 0){
      n = n > B%10 ? B%10 : n;
      B = B+ 10-B%10;
    }
    if(C%10 != 0){
      n = n > C%10 ? C%10 : n;
      C = C+ 10-C%10;
    }
    if(D%10 != 0){
      n = n > D%10 ? D%10 : n;
      D = D+ 10-D%10;
    }
    if(E%10 != 0){
      n = n > E%10 ? E%10 : n;
      E = E+ 10-E%10;
    }
    
    n = 10-n;
    int ans = A+B+C+D+E-n;
    System.out.println(ans);
  }
} Main static int[] ans; ans static Map<Integer, Integer> map; map public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int E = Integer.parseInt(sc.next());
    
    int n = 10;
    if(A%10 != 0){
      n = n > A%10 ? A%10 : n;
      A = A+ 10-A%10;
    }
    if(B%10 != 0){
      n = n > B%10 ? B%10 : n;
      B = B+ 10-B%10;
    }
    if(C%10 != 0){
      n = n > C%10 ? C%10 : n;
      C = C+ 10-C%10;
    }
    if(D%10 != 0){
      n = n > D%10 ? D%10 : n;
      D = D+ 10-D%10;
    }
    if(E%10 != 0){
      n = n > E%10 ? E%10 : n;
      E = E+ 10-E%10;
    }
    
    n = 10-n;
    int ans = A+B+C+D+E-n;
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int E = Integer.parseInt(sc.next());
    
    int n = 10;
    if(A%10 != 0){
      n = n > A%10 ? A%10 : n;
      A = A+ 10-A%10;
    }
    if(B%10 != 0){
      n = n > B%10 ? B%10 : n;
      B = B+ 10-B%10;
    }
    if(C%10 != 0){
      n = n > C%10 ? C%10 : n;
      C = C+ 10-C%10;
    }
    if(D%10 != 0){
      n = n > D%10 ? D%10 : n;
      D = D+ 10-D%10;
    }
    if(E%10 != 0){
      n = n > E%10 ? E%10 : n;
      E = E+ 10-E%10;
    }
    
    n = 10-n;
    int ans = A+B+C+D+E-n;
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int C = Integer.parseInt(sc.next()); C Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int D = Integer.parseInt(sc.next()); D Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int E = Integer.parseInt(sc.next()); E Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int n = 10; n 10 if(A%10 != 0){
      n = n > A%10 ? A%10 : n;
      A = A+ 10-A%10;
    } A%10 != 0 A%10 A 10 0 {
      n = n > A%10 ? A%10 : n;
      A = A+ 10-A%10;
    } n = n > A%10 ? A%10 : n n n > A%10 ? A%10 : n n > A%10 n A%10 A 10 A%10 A 10 n A = A+ 10-A%10 A A+ 10-A%10 A+ 10 A 10 A%10 A 10 if(B%10 != 0){
      n = n > B%10 ? B%10 : n;
      B = B+ 10-B%10;
    } B%10 != 0 B%10 B 10 0 {
      n = n > B%10 ? B%10 : n;
      B = B+ 10-B%10;
    } n = n > B%10 ? B%10 : n n n > B%10 ? B%10 : n n > B%10 n B%10 B 10 B%10 B 10 n B = B+ 10-B%10 B B+ 10-B%10 B+ 10 B 10 B%10 B 10 if(C%10 != 0){
      n = n > C%10 ? C%10 : n;
      C = C+ 10-C%10;
    } C%10 != 0 C%10 C 10 0 {
      n = n > C%10 ? C%10 : n;
      C = C+ 10-C%10;
    } n = n > C%10 ? C%10 : n n n > C%10 ? C%10 : n n > C%10 n C%10 C 10 C%10 C 10 n C = C+ 10-C%10 C C+ 10-C%10 C+ 10 C 10 C%10 C 10 if(D%10 != 0){
      n = n > D%10 ? D%10 : n;
      D = D+ 10-D%10;
    } D%10 != 0 D%10 D 10 0 {
      n = n > D%10 ? D%10 : n;
      D = D+ 10-D%10;
    } n = n > D%10 ? D%10 : n n n > D%10 ? D%10 : n n > D%10 n D%10 D 10 D%10 D 10 n D = D+ 10-D%10 D D+ 10-D%10 D+ 10 D 10 D%10 D 10 if(E%10 != 0){
      n = n > E%10 ? E%10 : n;
      E = E+ 10-E%10;
    } E%10 != 0 E%10 E 10 0 {
      n = n > E%10 ? E%10 : n;
      E = E+ 10-E%10;
    } n = n > E%10 ? E%10 : n n n > E%10 ? E%10 : n n > E%10 n E%10 E 10 E%10 E 10 n E = E+ 10-E%10 E E+ 10-E%10 E+ 10 E 10 E%10 E 10 n = 10-n n 10-n 10 n int ans = A+B+C+D+E-n; ans A+B+C+D+E-n A+B+C+D+E D C A+B+C+D+E A B C D E n System.out.println(ans) System.out.println System.out System System.out ans String[]args args public class Main{
  static int[] ans;
  static Map<Integer, Integer> map;
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int E = Integer.parseInt(sc.next());
    
    int n = 10;
    if(A%10 != 0){
      n = n > A%10 ? A%10 : n;
      A = A+ 10-A%10;
    }
    if(B%10 != 0){
      n = n > B%10 ? B%10 : n;
      B = B+ 10-B%10;
    }
    if(C%10 != 0){
      n = n > C%10 ? C%10 : n;
      C = C+ 10-C%10;
    }
    if(D%10 != 0){
      n = n > D%10 ? D%10 : n;
      D = D+ 10-D%10;
    }
    if(E%10 != 0){
      n = n > E%10 ? E%10 : n;
      E = E+ 10-E%10;
    }
    
    n = 10-n;
    int ans = A+B+C+D+E-n;
    System.out.println(ans);
  }
} public class Main{
  static int[] ans;
  static Map<Integer, Integer> map;
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int E = Integer.parseInt(sc.next());
    
    int n = 10;
    if(A%10 != 0){
      n = n > A%10 ? A%10 : n;
      A = A+ 10-A%10;
    }
    if(B%10 != 0){
      n = n > B%10 ? B%10 : n;
      B = B+ 10-B%10;
    }
    if(C%10 != 0){
      n = n > C%10 ? C%10 : n;
      C = C+ 10-C%10;
    }
    if(D%10 != 0){
      n = n > D%10 ? D%10 : n;
      D = D+ 10-D%10;
    }
    if(E%10 != 0){
      n = n > E%10 ? E%10 : n;
      E = E+ 10-E%10;
    }
    
    n = 10-n;
    int ans = A+B+C+D+E-n;
    System.out.println(ans);
  }
} Main
import java.util.*;

public class Main{
  static int[] ans;
  static Map<Integer, Integer> map;
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int E = Integer.parseInt(sc.next());
    
    int n = 10;
    if(A%10 != 0){
      n = n > A%10 ? A%10 : n;
      A = A+ 10-A%10;
    }
    if(B%10 != 0){
      n = n > B%10 ? B%10 : n;
      B = B+ 10-B%10;
    }
    if(C%10 != 0){
      n = n > C%10 ? C%10 : n;
      C = C+ 10-C%10;
    }
    if(D%10 != 0){
      n = n > D%10 ? D%10 : n;
      D = D+ 10-D%10;
    }
    if(E%10 != 0){
      n = n > E%10 ? E%10 : n;
      E = E+ 10-E%10;
    }
    
    n = 10-n;
    int ans = A+B+C+D+E-n;
    System.out.println(ans);
  }
}