import java.util.*;

public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int i, sum = 0, min_r = 10;
      	int[] time = new int[5];
      	for(i = 0; i < 5; i++) {
          time[i] = Integer.parseInt(sc.next());
          if(time[i] % 10 == 0) {
            sum += time[i];
          } else {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          }
        }
      	System.out.println(sum - (10 - min_r));
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int i, sum = 0, min_r = 10;
      	int[] time = new int[5];
      	for(i = 0; i < 5; i++) {
          time[i] = Integer.parseInt(sc.next());
          if(time[i] % 10 == 0) {
            sum += time[i];
          } else {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          }
        }
      	System.out.println(sum - (10 - min_r));
    }
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int i, sum = 0, min_r = 10;
      	int[] time = new int[5];
      	for(i = 0; i < 5; i++) {
          time[i] = Integer.parseInt(sc.next());
          if(time[i] % 10 == 0) {
            sum += time[i];
          } else {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          }
        }
      	System.out.println(sum - (10 - min_r));
    } main {
    	Scanner sc = new Scanner(System.in);
      	int i, sum = 0, min_r = 10;
      	int[] time = new int[5];
      	for(i = 0; i < 5; i++) {
          time[i] = Integer.parseInt(sc.next());
          if(time[i] % 10 == 0) {
            sum += time[i];
          } else {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          }
        }
      	System.out.println(sum - (10 - min_r));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int i i sum = 0 sum 0 min_r = 10; min_r 10 int[] time = new int[5]; time new int[5] 5 for(i = 0; i < 5; i++) {
          time[i] = Integer.parseInt(sc.next());
          if(time[i] % 10 == 0) {
            sum += time[i];
          } else {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          }
        } i = 0; i = 0 i 0 i < 5 i 5 i++ i++ i {
          time[i] = Integer.parseInt(sc.next());
          if(time[i] % 10 == 0) {
            sum += time[i];
          } else {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          }
        } {
          time[i] = Integer.parseInt(sc.next());
          if(time[i] % 10 == 0) {
            sum += time[i];
          } else {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          }
        } time[i] = Integer.parseInt(sc.next()) time[i] time i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if(time[i] % 10 == 0) {
            sum += time[i];
          } else {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          } time[i] % 10 == 0 time[i] % 10 time[i] time i 10 0 {
            sum += time[i];
          } sum += time[i] sum time[i] time i {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          } sum += time[i] + (10 - (time[i] % 10)) sum time[i] + (10 - (time[i] % 10)) time[i] time i (10 - (time[i] % 10)) 10 (time[i] % 10) time[i] time i 10 if(min_r > time[i] % 10) min_r = time[i] % 10; min_r > time[i] % 10 min_r time[i] % 10 time[i] time i 10 min_r = time[i] % 10 min_r time[i] % 10 time[i] time i 10 System.out.println(sum - (10 - min_r)) System.out.println System.out System System.out sum - (10 - min_r) sum (10 - min_r) 10 min_r String[] args args public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int i, sum = 0, min_r = 10;
      	int[] time = new int[5];
      	for(i = 0; i < 5; i++) {
          time[i] = Integer.parseInt(sc.next());
          if(time[i] % 10 == 0) {
            sum += time[i];
          } else {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          }
        }
      	System.out.println(sum - (10 - min_r));
    }
} public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int i, sum = 0, min_r = 10;
      	int[] time = new int[5];
      	for(i = 0; i < 5; i++) {
          time[i] = Integer.parseInt(sc.next());
          if(time[i] % 10 == 0) {
            sum += time[i];
          } else {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          }
        }
      	System.out.println(sum - (10 - min_r));
    }
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int i, sum = 0, min_r = 10;
      	int[] time = new int[5];
      	for(i = 0; i < 5; i++) {
          time[i] = Integer.parseInt(sc.next());
          if(time[i] % 10 == 0) {
            sum += time[i];
          } else {
          	sum += time[i] + (10 - (time[i] % 10));
            if(min_r > time[i] % 10) min_r = time[i] % 10;
          }
        }
      	System.out.println(sum - (10 - min_r));
    }
}