import java.util.*;

public class Main{

	public static void main(String[] args){

		Scanner sc =new Scanner(System.in);
		int[] dish = new int[5];
		for(int i=0;i<5;i++){
			dish[i] = sc.nextInt();
		}

		int[] point = new int[5];
		int[] ones_place=new int[5];
		for(int i=0;i<5;i++){
			if(dish[i] >=100){
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			}else if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}
		}

		Arrays.sort(ones_place);
		int time=0;

		for(int i=0;i<point.length;i++){
			time=time+point[i];
		}

		System.out.println(time-10+ones_place[0]);
	}
} import java.util.*; util.* java public class Main{

	public static void main(String[] args){

		Scanner sc =new Scanner(System.in);
		int[] dish = new int[5];
		for(int i=0;i<5;i++){
			dish[i] = sc.nextInt();
		}

		int[] point = new int[5];
		int[] ones_place=new int[5];
		for(int i=0;i<5;i++){
			if(dish[i] >=100){
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			}else if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}
		}

		Arrays.sort(ones_place);
		int time=0;

		for(int i=0;i<point.length;i++){
			time=time+point[i];
		}

		System.out.println(time-10+ones_place[0]);
	}
} Main public static void main(String[] args){

		Scanner sc =new Scanner(System.in);
		int[] dish = new int[5];
		for(int i=0;i<5;i++){
			dish[i] = sc.nextInt();
		}

		int[] point = new int[5];
		int[] ones_place=new int[5];
		for(int i=0;i<5;i++){
			if(dish[i] >=100){
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			}else if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}
		}

		Arrays.sort(ones_place);
		int time=0;

		for(int i=0;i<point.length;i++){
			time=time+point[i];
		}

		System.out.println(time-10+ones_place[0]);
	} main {

		Scanner sc =new Scanner(System.in);
		int[] dish = new int[5];
		for(int i=0;i<5;i++){
			dish[i] = sc.nextInt();
		}

		int[] point = new int[5];
		int[] ones_place=new int[5];
		for(int i=0;i<5;i++){
			if(dish[i] >=100){
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			}else if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}
		}

		Arrays.sort(ones_place);
		int time=0;

		for(int i=0;i<point.length;i++){
			time=time+point[i];
		}

		System.out.println(time-10+ones_place[0]);
	} Scanner sc =new Scanner(System.in); sc new Scanner(System.in) int[] dish = new int[5]; dish new int[5] 5 for(int i=0;i<5;i++){
			dish[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			dish[i] = sc.nextInt();
		} {
			dish[i] = sc.nextInt();
		} dish[i] = sc.nextInt() dish[i] dish i sc.nextInt() sc.nextInt sc int[] point = new int[5]; point new int[5] 5 int[] ones_place=new int[5]; ones_place new int[5] 5 for(int i=0;i<5;i++){
			if(dish[i] >=100){
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			}else if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			if(dish[i] >=100){
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			}else if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}
		} {
			if(dish[i] >=100){
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			}else if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}
		} if(dish[i] >=100){
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			}else if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				} dish[i] >=100 dish[i] dish i 100 {
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			} ones_place[i] = (dish[i]%100)%10 ones_place[i] ones_place i (dish[i]%100)%10 (dish[i]%100) dish[i] dish i 100 10 if(ones_place[i] == 0)
					ones_place[i] = 10; ones_place[i] == 0 ones_place[i] ones_place i 0 ones_place[i] = 10 ones_place[i] ones_place i 10 point[i] = dish[i]+10-ones_place[i] point[i] point i dish[i]+10-ones_place[i] dish[i]+10 dish[i] dish i 10 ones_place[i] ones_place i if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				} dish[i]>=10 dish[i] dish i 10 {
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				} ones_place[i]=dish[i]%10 ones_place[i] ones_place i dish[i]%10 dish[i] dish i 10 if(ones_place[i] == 0)
					ones_place[i] = 10; ones_place[i] == 0 ones_place[i] ones_place i 0 ones_place[i] = 10 ones_place[i] ones_place i 10 point[i] = dish[i]+10-ones_place[i] point[i] point i dish[i]+10-ones_place[i] dish[i]+10 dish[i] dish i 10 ones_place[i] ones_place i {
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				} ones_place[i]=dish[i] ones_place[i] ones_place i dish[i] dish i if(ones_place[i] == 0)
					ones_place[i] = 10; ones_place[i] == 0 ones_place[i] ones_place i 0 ones_place[i] = 10 ones_place[i] ones_place i 10 point[i] = dish[i]+10-ones_place[i] point[i] point i dish[i]+10-ones_place[i] dish[i]+10 dish[i] dish i 10 ones_place[i] ones_place i Arrays.sort(ones_place) Arrays.sort Arrays ones_place int time=0; time 0 for(int i=0;i<point.length;i++){
			time=time+point[i];
		} int i=0; int i=0; i 0 i<point.length i point.length point point.length i++ i++ i {
			time=time+point[i];
		} {
			time=time+point[i];
		} time=time+point[i] time time+point[i] time point[i] point i System.out.println(time-10+ones_place[0]) System.out.println System.out System System.out time-10+ones_place[0] time-10 time 10 ones_place[0] ones_place 0 String[] args args public class Main{

	public static void main(String[] args){

		Scanner sc =new Scanner(System.in);
		int[] dish = new int[5];
		for(int i=0;i<5;i++){
			dish[i] = sc.nextInt();
		}

		int[] point = new int[5];
		int[] ones_place=new int[5];
		for(int i=0;i<5;i++){
			if(dish[i] >=100){
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			}else if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}
		}

		Arrays.sort(ones_place);
		int time=0;

		for(int i=0;i<point.length;i++){
			time=time+point[i];
		}

		System.out.println(time-10+ones_place[0]);
	}
} public class Main{

	public static void main(String[] args){

		Scanner sc =new Scanner(System.in);
		int[] dish = new int[5];
		for(int i=0;i<5;i++){
			dish[i] = sc.nextInt();
		}

		int[] point = new int[5];
		int[] ones_place=new int[5];
		for(int i=0;i<5;i++){
			if(dish[i] >=100){
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			}else if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}
		}

		Arrays.sort(ones_place);
		int time=0;

		for(int i=0;i<point.length;i++){
			time=time+point[i];
		}

		System.out.println(time-10+ones_place[0]);
	}
} Main
import java.util.*;

public class Main{

	public static void main(String[] args){

		Scanner sc =new Scanner(System.in);
		int[] dish = new int[5];
		for(int i=0;i<5;i++){
			dish[i] = sc.nextInt();
		}

		int[] point = new int[5];
		int[] ones_place=new int[5];
		for(int i=0;i<5;i++){
			if(dish[i] >=100){
				ones_place[i] = (dish[i]%100)%10;
				if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				
			}else if(dish[i]>=10){
					ones_place[i]=dish[i]%10;
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}else{
					ones_place[i]=dish[i];
					if(ones_place[i] == 0)
					ones_place[i] = 10;

					point[i] = dish[i]+10-ones_place[i];
				}
		}

		Arrays.sort(ones_place);
		int time=0;

		for(int i=0;i<point.length;i++){
			time=time+point[i];
		}

		System.out.println(time-10+ones_place[0]);
	}
}