import java.util.Scanner;
 
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    // 5つの調理時間の入力
    int[] arr = new int[5];
    for (int i=0; i<arr.length; i++) {
    	arr[i] = sc.nextInt();
    }
    
    // 一番最後に注文する料理を計算
    // 割り切れず、あまりが最小のもの
    int last_dish = 6;
    int amari_smallest = 11;
    int amari = 0;
    
    for (int i=0; i<arr.length; i++) {
    	if (arr[i] % 10 != 0) {
        	amari = arr[i] % 10;
            if (amari < amari_smallest) {
            	amari_smallest = amari;
                last_dish = i;
            }
        }
    }
    
    // 最後の料理以外は10で切り上げた後で10倍する
    int total = 0;
    for (int i=0; i<arr.length; i++) {
    	if (i==last_dish) {
        	total += arr[i];
        } else {
        	total += ((arr[i] + 10 - 1) / 10 ) * 10;
        }
    }
    
    // 出力
    System.out.println(total);
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    // 5つの調理時間の入力
    int[] arr = new int[5];
    for (int i=0; i<arr.length; i++) {
    	arr[i] = sc.nextInt();
    }
    
    // 一番最後に注文する料理を計算
    // 割り切れず、あまりが最小のもの
    int last_dish = 6;
    int amari_smallest = 11;
    int amari = 0;
    
    for (int i=0; i<arr.length; i++) {
    	if (arr[i] % 10 != 0) {
        	amari = arr[i] % 10;
            if (amari < amari_smallest) {
            	amari_smallest = amari;
                last_dish = i;
            }
        }
    }
    
    // 最後の料理以外は10で切り上げた後で10倍する
    int total = 0;
    for (int i=0; i<arr.length; i++) {
    	if (i==last_dish) {
        	total += arr[i];
        } else {
        	total += ((arr[i] + 10 - 1) / 10 ) * 10;
        }
    }
    
    // 出力
    System.out.println(total);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    // 5つの調理時間の入力
    int[] arr = new int[5];
    for (int i=0; i<arr.length; i++) {
    	arr[i] = sc.nextInt();
    }
    
    // 一番最後に注文する料理を計算
    // 割り切れず、あまりが最小のもの
    int last_dish = 6;
    int amari_smallest = 11;
    int amari = 0;
    
    for (int i=0; i<arr.length; i++) {
    	if (arr[i] % 10 != 0) {
        	amari = arr[i] % 10;
            if (amari < amari_smallest) {
            	amari_smallest = amari;
                last_dish = i;
            }
        }
    }
    
    // 最後の料理以外は10で切り上げた後で10倍する
    int total = 0;
    for (int i=0; i<arr.length; i++) {
    	if (i==last_dish) {
        	total += arr[i];
        } else {
        	total += ((arr[i] + 10 - 1) / 10 ) * 10;
        }
    }
    
    // 出力
    System.out.println(total);
  } main {
    Scanner sc = new Scanner(System.in);
    
    // 5つの調理時間の入力
    int[] arr = new int[5];
    for (int i=0; i<arr.length; i++) {
    	arr[i] = sc.nextInt();
    }
    
    // 一番最後に注文する料理を計算
    // 割り切れず、あまりが最小のもの
    int last_dish = 6;
    int amari_smallest = 11;
    int amari = 0;
    
    for (int i=0; i<arr.length; i++) {
    	if (arr[i] % 10 != 0) {
        	amari = arr[i] % 10;
            if (amari < amari_smallest) {
            	amari_smallest = amari;
                last_dish = i;
            }
        }
    }
    
    // 最後の料理以外は10で切り上げた後で10倍する
    int total = 0;
    for (int i=0; i<arr.length; i++) {
    	if (i==last_dish) {
        	total += arr[i];
        } else {
        	total += ((arr[i] + 10 - 1) / 10 ) * 10;
        }
    }
    
    // 出力
    System.out.println(total);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] arr = new int[5]; arr new int[5] 5 for (int i=0; i<arr.length; i++) {
    	arr[i] = sc.nextInt();
    } int i=0; int i=0; i 0 i<arr.length i arr.length arr arr.length i++ i++ i {
    	arr[i] = sc.nextInt();
    } {
    	arr[i] = sc.nextInt();
    } arr[i] = sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc int last_dish = 6; last_dish 6 int amari_smallest = 11; amari_smallest 11 int amari = 0; amari 0 for (int i=0; i<arr.length; i++) {
    	if (arr[i] % 10 != 0) {
        	amari = arr[i] % 10;
            if (amari < amari_smallest) {
            	amari_smallest = amari;
                last_dish = i;
            }
        }
    } int i=0; int i=0; i 0 i<arr.length i arr.length arr arr.length i++ i++ i {
    	if (arr[i] % 10 != 0) {
        	amari = arr[i] % 10;
            if (amari < amari_smallest) {
            	amari_smallest = amari;
                last_dish = i;
            }
        }
    } {
    	if (arr[i] % 10 != 0) {
        	amari = arr[i] % 10;
            if (amari < amari_smallest) {
            	amari_smallest = amari;
                last_dish = i;
            }
        }
    } if (arr[i] % 10 != 0) {
        	amari = arr[i] % 10;
            if (amari < amari_smallest) {
            	amari_smallest = amari;
                last_dish = i;
            }
        } arr[i] % 10 != 0 arr[i] % 10 arr[i] arr i 10 0 {
        	amari = arr[i] % 10;
            if (amari < amari_smallest) {
            	amari_smallest = amari;
                last_dish = i;
            }
        } amari = arr[i] % 10 amari arr[i] % 10 arr[i] arr i 10 if (amari < amari_smallest) {
            	amari_smallest = amari;
                last_dish = i;
            } amari < amari_smallest amari amari_smallest {
            	amari_smallest = amari;
                last_dish = i;
            } amari_smallest = amari amari_smallest amari last_dish = i last_dish i int total = 0; total 0 for (int i=0; i<arr.length; i++) {
    	if (i==last_dish) {
        	total += arr[i];
        } else {
        	total += ((arr[i] + 10 - 1) / 10 ) * 10;
        }
    } int i=0; int i=0; i 0 i<arr.length i arr.length arr arr.length i++ i++ i {
    	if (i==last_dish) {
        	total += arr[i];
        } else {
        	total += ((arr[i] + 10 - 1) / 10 ) * 10;
        }
    } {
    	if (i==last_dish) {
        	total += arr[i];
        } else {
        	total += ((arr[i] + 10 - 1) / 10 ) * 10;
        }
    } if (i==last_dish) {
        	total += arr[i];
        } else {
        	total += ((arr[i] + 10 - 1) / 10 ) * 10;
        } i==last_dish i last_dish {
        	total += arr[i];
        } total += arr[i] total arr[i] arr i {
        	total += ((arr[i] + 10 - 1) / 10 ) * 10;
        } total += ((arr[i] + 10 - 1) / 10 ) * 10 total ((arr[i] + 10 - 1) / 10 ) * 10 ((arr[i] + 10 - 1) / 10 ) (arr[i] + 10 - 1) arr[i] + 10 arr[i] arr i 10 1 10 10 System.out.println(total) System.out.println System.out System System.out total String[] args args
import java.util.Scanner;
 
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    // 5つの調理時間の入力
    int[] arr = new int[5];
    for (int i=0; i<arr.length; i++) {
    	arr[i] = sc.nextInt();
    }
    
    // 一番最後に注文する料理を計算
    // 割り切れず、あまりが最小のもの
    int last_dish = 6;
    int amari_smallest = 11;
    int amari = 0;
    
    for (int i=0; i<arr.length; i++) {
    	if (arr[i] % 10 != 0) {
        	amari = arr[i] % 10;
            if (amari < amari_smallest) {
            	amari_smallest = amari;
                last_dish = i;
            }
        }
    }
    
    // 最後の料理以外は10で切り上げた後で10倍する
    int total = 0;
    for (int i=0; i<arr.length; i++) {
    	if (i==last_dish) {
        	total += arr[i];
        } else {
        	total += ((arr[i] + 10 - 1) / 10 ) * 10;
        }
    }
    
    // 出力
    System.out.println(total);
  }
}