import java.util.Scanner;
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++){
			int d = sc.nextInt();
			dish[i] = d;
		}
		int minid = 0;
		int min = 10;
		for(int i = 0; i < 5; i++){
			if(dish[i]%10 != 0){	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			}	
		}
		int sum = 0;
		for(int i = 0; i < 5; i++){
			if(i == minid){
				sum += dish[i];
			}else{
				sum += ((dish[i] + 9)/10*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[] dish = new int[5];
		for(int i = 0; i < 5; i++){
			int d = sc.nextInt();
			dish[i] = d;
		}
		int minid = 0;
		int min = 10;
		for(int i = 0; i < 5; i++){
			if(dish[i]%10 != 0){	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			}	
		}
		int sum = 0;
		for(int i = 0; i < 5; i++){
			if(i == minid){
				sum += dish[i];
			}else{
				sum += ((dish[i] + 9)/10*10);
			}
		}
		System.out.println(sum);
	}
} 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++){
			int d = sc.nextInt();
			dish[i] = d;
		}
		int minid = 0;
		int min = 10;
		for(int i = 0; i < 5; i++){
			if(dish[i]%10 != 0){	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			}	
		}
		int sum = 0;
		for(int i = 0; i < 5; i++){
			if(i == minid){
				sum += dish[i];
			}else{
				sum += ((dish[i] + 9)/10*10);
			}
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int[] dish = new int[5];
		for(int i = 0; i < 5; i++){
			int d = sc.nextInt();
			dish[i] = d;
		}
		int minid = 0;
		int min = 10;
		for(int i = 0; i < 5; i++){
			if(dish[i]%10 != 0){	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			}	
		}
		int sum = 0;
		for(int i = 0; i < 5; i++){
			if(i == minid){
				sum += dish[i];
			}else{
				sum += ((dish[i] + 9)/10*10);
			}
		}
		System.out.println(sum);
	} 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++){
			int d = sc.nextInt();
			dish[i] = d;
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			int d = sc.nextInt();
			dish[i] = d;
		} {
			int d = sc.nextInt();
			dish[i] = d;
		} int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc dish[i] = d dish[i] dish i d int minid = 0; minid 0 int min = 10; min 10 for(int i = 0; i < 5; i++){
			if(dish[i]%10 != 0){	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			}	
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if(dish[i]%10 != 0){	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			}	
		} {
			if(dish[i]%10 != 0){	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			}	
		} if(dish[i]%10 != 0){	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			} dish[i]%10 != 0 dish[i]%10 dish[i] dish i 10 0 {	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			} if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				} dish[i]%10 < min dish[i]%10 dish[i] dish i 10 min {
					min = dish[i]%10;
					minid = i;
				} min = dish[i]%10 min dish[i]%10 dish[i] dish i 10 minid = i minid i int sum = 0; sum 0 for(int i = 0; i < 5; i++){
			if(i == minid){
				sum += dish[i];
			}else{
				sum += ((dish[i] + 9)/10*10);
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if(i == minid){
				sum += dish[i];
			}else{
				sum += ((dish[i] + 9)/10*10);
			}
		} {
			if(i == minid){
				sum += dish[i];
			}else{
				sum += ((dish[i] + 9)/10*10);
			}
		} if(i == minid){
				sum += dish[i];
			}else{
				sum += ((dish[i] + 9)/10*10);
			} i == minid i minid {
				sum += dish[i];
			} sum += dish[i] sum dish[i] dish i {
				sum += ((dish[i] + 9)/10*10);
			} sum += ((dish[i] + 9)/10*10) sum ((dish[i] + 9)/10*10) (dish[i] + 9)/10 (dish[i] + 9) dish[i] dish i 9 10 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[] dish = new int[5];
		for(int i = 0; i < 5; i++){
			int d = sc.nextInt();
			dish[i] = d;
		}
		int minid = 0;
		int min = 10;
		for(int i = 0; i < 5; i++){
			if(dish[i]%10 != 0){	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			}	
		}
		int sum = 0;
		for(int i = 0; i < 5; i++){
			if(i == minid){
				sum += dish[i];
			}else{
				sum += ((dish[i] + 9)/10*10);
			}
		}
		System.out.println(sum);
	}
} 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++){
			int d = sc.nextInt();
			dish[i] = d;
		}
		int minid = 0;
		int min = 10;
		for(int i = 0; i < 5; i++){
			if(dish[i]%10 != 0){	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			}	
		}
		int sum = 0;
		for(int i = 0; i < 5; i++){
			if(i == minid){
				sum += dish[i];
			}else{
				sum += ((dish[i] + 9)/10*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[] dish = new int[5];
		for(int i = 0; i < 5; i++){
			int d = sc.nextInt();
			dish[i] = d;
		}
		int minid = 0;
		int min = 10;
		for(int i = 0; i < 5; i++){
			if(dish[i]%10 != 0){	
				if(dish[i]%10 < min){
					min = dish[i]%10;
					minid = i;
				}
			}	
		}
		int sum = 0;
		for(int i = 0; i < 5; i++){
			if(i == minid){
				sum += dish[i];
			}else{
				sum += ((dish[i] + 9)/10*10);
			}
		}
		System.out.println(sum);
	}
}