import java.util.*;
public class Main{
  public static void main(String[] args){
  	Scanner sc = new Scanner(System.in);
    int[] nums = new int[5];
    for(int i = 0;i < 5;i++){
      nums[i] = sc.nextInt();
    }
    int tail = Integer.MAX_VALUE;
    int min = 0;
    for(int j = 0;j < nums.length;j++){
      	int temp = nums[j] % 10;
    	if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        }
    }
    int sum = 0;
    for(int j = 0;j < nums.length;j++){
    	if(j != min){
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        }
    }
    System.out.println(sum + nums[min]);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
  	Scanner sc = new Scanner(System.in);
    int[] nums = new int[5];
    for(int i = 0;i < 5;i++){
      nums[i] = sc.nextInt();
    }
    int tail = Integer.MAX_VALUE;
    int min = 0;
    for(int j = 0;j < nums.length;j++){
      	int temp = nums[j] % 10;
    	if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        }
    }
    int sum = 0;
    for(int j = 0;j < nums.length;j++){
    	if(j != min){
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        }
    }
    System.out.println(sum + nums[min]);
  }
} Main public static void main(String[] args){
  	Scanner sc = new Scanner(System.in);
    int[] nums = new int[5];
    for(int i = 0;i < 5;i++){
      nums[i] = sc.nextInt();
    }
    int tail = Integer.MAX_VALUE;
    int min = 0;
    for(int j = 0;j < nums.length;j++){
      	int temp = nums[j] % 10;
    	if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        }
    }
    int sum = 0;
    for(int j = 0;j < nums.length;j++){
    	if(j != min){
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        }
    }
    System.out.println(sum + nums[min]);
  } main {
  	Scanner sc = new Scanner(System.in);
    int[] nums = new int[5];
    for(int i = 0;i < 5;i++){
      nums[i] = sc.nextInt();
    }
    int tail = Integer.MAX_VALUE;
    int min = 0;
    for(int j = 0;j < nums.length;j++){
      	int temp = nums[j] % 10;
    	if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        }
    }
    int sum = 0;
    for(int j = 0;j < nums.length;j++){
    	if(j != min){
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        }
    }
    System.out.println(sum + nums[min]);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] nums = new int[5]; nums new int[5] 5 for(int i = 0;i < 5;i++){
      nums[i] = sc.nextInt();
    } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
      nums[i] = sc.nextInt();
    } {
      nums[i] = sc.nextInt();
    } nums[i] = sc.nextInt() nums[i] nums i sc.nextInt() sc.nextInt sc int tail = Integer.MAX_VALUE; tail Integer.MAX_VALUE Integer Integer.MAX_VALUE int min = 0; min 0 for(int j = 0;j < nums.length;j++){
      	int temp = nums[j] % 10;
    	if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        }
    } int j = 0; int j = 0; j 0 j < nums.length j nums.length nums nums.length j++ j++ j {
      	int temp = nums[j] % 10;
    	if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        }
    } {
      	int temp = nums[j] % 10;
    	if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        }
    } int temp = nums[j] % 10; temp nums[j] % 10 nums[j] nums j 10 if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        } temp != 0 && tail > temp temp != 0 temp 0 tail > temp tail temp {
        	tail = temp;
          	min = j;
        } tail = temp tail temp min = j min j int sum = 0; sum 0 for(int j = 0;j < nums.length;j++){
    	if(j != min){
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        }
    } int j = 0; int j = 0; j 0 j < nums.length j nums.length nums nums.length j++ j++ j {
    	if(j != min){
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        }
    } {
    	if(j != min){
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        }
    } if(j != min){
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        } j != min j min {
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        } if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          } nums[j] % 10 == 0 nums[j] % 10 nums[j] nums j 10 0 {
             sum += nums[j];
          } sum += nums[j] sum nums[j] nums j {
            sum += (nums[j] / 10) *10 + 10;
          } sum += (nums[j] / 10) *10 + 10 sum (nums[j] / 10) *10 + 10 (nums[j] / 10) *10 (nums[j] / 10) nums[j] nums j 10 10 10 System.out.println(sum + nums[min]) System.out.println System.out System System.out sum + nums[min] sum nums[min] nums min String[] args args public class Main{
  public static void main(String[] args){
  	Scanner sc = new Scanner(System.in);
    int[] nums = new int[5];
    for(int i = 0;i < 5;i++){
      nums[i] = sc.nextInt();
    }
    int tail = Integer.MAX_VALUE;
    int min = 0;
    for(int j = 0;j < nums.length;j++){
      	int temp = nums[j] % 10;
    	if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        }
    }
    int sum = 0;
    for(int j = 0;j < nums.length;j++){
    	if(j != min){
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        }
    }
    System.out.println(sum + nums[min]);
  }
} public class Main{
  public static void main(String[] args){
  	Scanner sc = new Scanner(System.in);
    int[] nums = new int[5];
    for(int i = 0;i < 5;i++){
      nums[i] = sc.nextInt();
    }
    int tail = Integer.MAX_VALUE;
    int min = 0;
    for(int j = 0;j < nums.length;j++){
      	int temp = nums[j] % 10;
    	if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        }
    }
    int sum = 0;
    for(int j = 0;j < nums.length;j++){
    	if(j != min){
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        }
    }
    System.out.println(sum + nums[min]);
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
  	Scanner sc = new Scanner(System.in);
    int[] nums = new int[5];
    for(int i = 0;i < 5;i++){
      nums[i] = sc.nextInt();
    }
    int tail = Integer.MAX_VALUE;
    int min = 0;
    for(int j = 0;j < nums.length;j++){
      	int temp = nums[j] % 10;
    	if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        }
    }
    int sum = 0;
    for(int j = 0;j < nums.length;j++){
    	if(j != min){
          if(nums[j] % 10 == 0){
             sum += nums[j];
          }else{
            sum += (nums[j] / 10) *10 + 10;
          }
        }
    }
    System.out.println(sum + nums[min]);
  }
}