import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] food = new int[5];
		food[0] = scan.nextInt();
		food[1] = scan.nextInt();
		food[2] = scan.nextInt();
		food[3] = scan.nextInt();
		food[4] = scan.nextInt();
		int min = 10;
		int minNum = 0;
		int total = 0;
		int t = 0;
		for(int i=0;i<5;i++){
			if(min>food[i]%10){
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			}
		}
		for(int j=0;j<5;j++){
			if(j==minNum){
				total = total + food[j];
			}
			else{
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			}
		}
		System.out.println(total);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] food = new int[5];
		food[0] = scan.nextInt();
		food[1] = scan.nextInt();
		food[2] = scan.nextInt();
		food[3] = scan.nextInt();
		food[4] = scan.nextInt();
		int min = 10;
		int minNum = 0;
		int total = 0;
		int t = 0;
		for(int i=0;i<5;i++){
			if(min>food[i]%10){
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			}
		}
		for(int j=0;j<5;j++){
			if(j==minNum){
				total = total + food[j];
			}
			else{
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			}
		}
		System.out.println(total);
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] food = new int[5];
		food[0] = scan.nextInt();
		food[1] = scan.nextInt();
		food[2] = scan.nextInt();
		food[3] = scan.nextInt();
		food[4] = scan.nextInt();
		int min = 10;
		int minNum = 0;
		int total = 0;
		int t = 0;
		for(int i=0;i<5;i++){
			if(min>food[i]%10){
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			}
		}
		for(int j=0;j<5;j++){
			if(j==minNum){
				total = total + food[j];
			}
			else{
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			}
		}
		System.out.println(total);
	} main {
		Scanner scan = new Scanner(System.in);
		int[] food = new int[5];
		food[0] = scan.nextInt();
		food[1] = scan.nextInt();
		food[2] = scan.nextInt();
		food[3] = scan.nextInt();
		food[4] = scan.nextInt();
		int min = 10;
		int minNum = 0;
		int total = 0;
		int t = 0;
		for(int i=0;i<5;i++){
			if(min>food[i]%10){
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			}
		}
		for(int j=0;j<5;j++){
			if(j==minNum){
				total = total + food[j];
			}
			else{
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			}
		}
		System.out.println(total);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[] food = new int[5]; food new int[5] 5 food[0] = scan.nextInt() food[0] food 0 scan.nextInt() scan.nextInt scan food[1] = scan.nextInt() food[1] food 1 scan.nextInt() scan.nextInt scan food[2] = scan.nextInt() food[2] food 2 scan.nextInt() scan.nextInt scan food[3] = scan.nextInt() food[3] food 3 scan.nextInt() scan.nextInt scan food[4] = scan.nextInt() food[4] food 4 scan.nextInt() scan.nextInt scan int min = 10; min 10 int minNum = 0; minNum 0 int total = 0; total 0 int t = 0; t 0 for(int i=0;i<5;i++){
			if(min>food[i]%10){
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			}
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			if(min>food[i]%10){
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			}
		} {
			if(min>food[i]%10){
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			}
		} if(min>food[i]%10){
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			} min>food[i]%10 min food[i]%10 food[i] food i 10 {
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			} if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			} food[i]%10!=0 food[i]%10 food[i] food i 10 0 {
				min = food[0]%10;
				minNum = i;
			} min = food[0]%10 min food[0]%10 food[0] food 0 10 minNum = i minNum i for(int j=0;j<5;j++){
			if(j==minNum){
				total = total + food[j];
			}
			else{
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			}
		} int j=0; int j=0; j 0 j<5 j 5 j++ j++ j {
			if(j==minNum){
				total = total + food[j];
			}
			else{
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			}
		} {
			if(j==minNum){
				total = total + food[j];
			}
			else{
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			}
		} if(j==minNum){
				total = total + food[j];
			}
			else{
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			} j==minNum j minNum {
				total = total + food[j];
			} total = total + food[j] total total + food[j] total food[j] food j {
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			} t=food[j]/10 t food[j]/10 food[j] food j 10 if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;} food[j]%10==0 food[j]%10 food[j] food j 10 0 {total = total + t*10;
				} total = total + t*10 total total + t*10 total t*10 t 10 {total = total + (t+1)*10;} total = total + (t+1)*10 total total + (t+1)*10 total (t+1)*10 (t+1) t 1 10 System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] food = new int[5];
		food[0] = scan.nextInt();
		food[1] = scan.nextInt();
		food[2] = scan.nextInt();
		food[3] = scan.nextInt();
		food[4] = scan.nextInt();
		int min = 10;
		int minNum = 0;
		int total = 0;
		int t = 0;
		for(int i=0;i<5;i++){
			if(min>food[i]%10){
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			}
		}
		for(int j=0;j<5;j++){
			if(j==minNum){
				total = total + food[j];
			}
			else{
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			}
		}
		System.out.println(total);
	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] food = new int[5];
		food[0] = scan.nextInt();
		food[1] = scan.nextInt();
		food[2] = scan.nextInt();
		food[3] = scan.nextInt();
		food[4] = scan.nextInt();
		int min = 10;
		int minNum = 0;
		int total = 0;
		int t = 0;
		for(int i=0;i<5;i++){
			if(min>food[i]%10){
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			}
		}
		for(int j=0;j<5;j++){
			if(j==minNum){
				total = total + food[j];
			}
			else{
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			}
		}
		System.out.println(total);
	}
} Main
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] food = new int[5];
		food[0] = scan.nextInt();
		food[1] = scan.nextInt();
		food[2] = scan.nextInt();
		food[3] = scan.nextInt();
		food[4] = scan.nextInt();
		int min = 10;
		int minNum = 0;
		int total = 0;
		int t = 0;
		for(int i=0;i<5;i++){
			if(min>food[i]%10){
				if(food[i]%10!=0){
				min = food[0]%10;
				minNum = i;
			}
			}
		}
		for(int j=0;j<5;j++){
			if(j==minNum){
				total = total + food[j];
			}
			else{
				t=food[j]/10;
				if(food[j]%10==0){total = total + t*10;
				}
				else{total = total + (t+1)*10;}
			}
		}
		System.out.println(total);
	}
}