import java.util.Scanner;
public class Main{
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int arr[] = new int[5];
	int count = 129;
	int number = 0;
	int sum = 0;
		for(int i=0; i<5; i++){
		arr[i] = sc.nextInt();
			if(arr[i]%10!=0 && arr[i]%10<=count%10){
			count = arr[i];
			number = i;
			}
			if(arr[i]%10==0){
			sum = sum + arr[i];
			}
			if(arr[i]%10!=0){
			sum = sum + (arr[i]/10+1)*10;
			}
		}
		if(count!=129){
		sum = sum - (10-arr[number]%10);
		}
	System.out.println(sum);
	}
}
	 import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int arr[] = new int[5];
	int count = 129;
	int number = 0;
	int sum = 0;
		for(int i=0; i<5; i++){
		arr[i] = sc.nextInt();
			if(arr[i]%10!=0 && arr[i]%10<=count%10){
			count = arr[i];
			number = i;
			}
			if(arr[i]%10==0){
			sum = sum + arr[i];
			}
			if(arr[i]%10!=0){
			sum = sum + (arr[i]/10+1)*10;
			}
		}
		if(count!=129){
		sum = sum - (10-arr[number]%10);
		}
	System.out.println(sum);
	}
} Main public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int arr[] = new int[5];
	int count = 129;
	int number = 0;
	int sum = 0;
		for(int i=0; i<5; i++){
		arr[i] = sc.nextInt();
			if(arr[i]%10!=0 && arr[i]%10<=count%10){
			count = arr[i];
			number = i;
			}
			if(arr[i]%10==0){
			sum = sum + arr[i];
			}
			if(arr[i]%10!=0){
			sum = sum + (arr[i]/10+1)*10;
			}
		}
		if(count!=129){
		sum = sum - (10-arr[number]%10);
		}
	System.out.println(sum);
	} main {
	Scanner sc = new Scanner(System.in);
	int arr[] = new int[5];
	int count = 129;
	int number = 0;
	int sum = 0;
		for(int i=0; i<5; i++){
		arr[i] = sc.nextInt();
			if(arr[i]%10!=0 && arr[i]%10<=count%10){
			count = arr[i];
			number = i;
			}
			if(arr[i]%10==0){
			sum = sum + arr[i];
			}
			if(arr[i]%10!=0){
			sum = sum + (arr[i]/10+1)*10;
			}
		}
		if(count!=129){
		sum = sum - (10-arr[number]%10);
		}
	System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int arr[] = new int[5]; arr new int[5] 5 int count = 129; count 129 int number = 0; number 0 int sum = 0; sum 0 for(int i=0; i<5; i++){
		arr[i] = sc.nextInt();
			if(arr[i]%10!=0 && arr[i]%10<=count%10){
			count = arr[i];
			number = i;
			}
			if(arr[i]%10==0){
			sum = sum + arr[i];
			}
			if(arr[i]%10!=0){
			sum = sum + (arr[i]/10+1)*10;
			}
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
		arr[i] = sc.nextInt();
			if(arr[i]%10!=0 && arr[i]%10<=count%10){
			count = arr[i];
			number = i;
			}
			if(arr[i]%10==0){
			sum = sum + arr[i];
			}
			if(arr[i]%10!=0){
			sum = sum + (arr[i]/10+1)*10;
			}
		} {
		arr[i] = sc.nextInt();
			if(arr[i]%10!=0 && arr[i]%10<=count%10){
			count = arr[i];
			number = i;
			}
			if(arr[i]%10==0){
			sum = sum + arr[i];
			}
			if(arr[i]%10!=0){
			sum = sum + (arr[i]/10+1)*10;
			}
		} arr[i] = sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc if(arr[i]%10!=0 && arr[i]%10<=count%10){
			count = arr[i];
			number = i;
			} arr[i]%10!=0 && arr[i]%10<=count%10 arr[i]%10!=0 arr[i]%10 arr[i] arr i 10 0 arr[i]%10<=count%10 arr[i]%10 arr[i] arr i 10 count%10 count 10 {
			count = arr[i];
			number = i;
			} count = arr[i] count arr[i] arr i number = i number i if(arr[i]%10==0){
			sum = sum + arr[i];
			} arr[i]%10==0 arr[i]%10 arr[i] arr i 10 0 {
			sum = sum + arr[i];
			} sum = sum + arr[i] sum sum + arr[i] sum arr[i] arr i if(arr[i]%10!=0){
			sum = sum + (arr[i]/10+1)*10;
			} arr[i]%10!=0 arr[i]%10 arr[i] arr i 10 0 {
			sum = sum + (arr[i]/10+1)*10;
			} sum = sum + (arr[i]/10+1)*10 sum sum + (arr[i]/10+1)*10 sum (arr[i]/10+1)*10 (arr[i]/10+1) arr[i]/10 arr[i] arr i 10 1 10 if(count!=129){
		sum = sum - (10-arr[number]%10);
		} count!=129 count 129 {
		sum = sum - (10-arr[number]%10);
		} sum = sum - (10-arr[number]%10) sum sum - (10-arr[number]%10) sum (10-arr[number]%10) 10 arr[number]%10 arr[number] arr number 10 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main{
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int arr[] = new int[5];
	int count = 129;
	int number = 0;
	int sum = 0;
		for(int i=0; i<5; i++){
		arr[i] = sc.nextInt();
			if(arr[i]%10!=0 && arr[i]%10<=count%10){
			count = arr[i];
			number = i;
			}
			if(arr[i]%10==0){
			sum = sum + arr[i];
			}
			if(arr[i]%10!=0){
			sum = sum + (arr[i]/10+1)*10;
			}
		}
		if(count!=129){
		sum = sum - (10-arr[number]%10);
		}
	System.out.println(sum);
	}
} public class Main{
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int arr[] = new int[5];
	int count = 129;
	int number = 0;
	int sum = 0;
		for(int i=0; i<5; i++){
		arr[i] = sc.nextInt();
			if(arr[i]%10!=0 && arr[i]%10<=count%10){
			count = arr[i];
			number = i;
			}
			if(arr[i]%10==0){
			sum = sum + arr[i];
			}
			if(arr[i]%10!=0){
			sum = sum + (arr[i]/10+1)*10;
			}
		}
		if(count!=129){
		sum = sum - (10-arr[number]%10);
		}
	System.out.println(sum);
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int arr[] = new int[5];
	int count = 129;
	int number = 0;
	int sum = 0;
		for(int i=0; i<5; i++){
		arr[i] = sc.nextInt();
			if(arr[i]%10!=0 && arr[i]%10<=count%10){
			count = arr[i];
			number = i;
			}
			if(arr[i]%10==0){
			sum = sum + arr[i];
			}
			if(arr[i]%10!=0){
			sum = sum + (arr[i]/10+1)*10;
			}
		}
		if(count!=129){
		sum = sum - (10-arr[number]%10);
		}
	System.out.println(sum);
	}
}
	