import java.util.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] input = new int[5];
		int[] roundUp = new int[5];
		int max = 0, index = 0, ans = 0;
 
		for(int i = 0; i < 5; i++){
			input[i] = sc.nextInt();
			roundUp[i] = (input[i] + 9) / 10 * 10;
			if(max < roundUp[i] - input[i]){
				max = roundUp[i] - input[i];
				index = i;
			}
		}
		for(int i = 0; i < 5; i++){
			ans += roundUp[i];
		}
		ans -= max;
		System.out.println(ans);
	}
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] input = new int[5];
		int[] roundUp = new int[5];
		int max = 0, index = 0, ans = 0;
 
		for(int i = 0; i < 5; i++){
			input[i] = sc.nextInt();
			roundUp[i] = (input[i] + 9) / 10 * 10;
			if(max < roundUp[i] - input[i]){
				max = roundUp[i] - input[i];
				index = i;
			}
		}
		for(int i = 0; i < 5; i++){
			ans += roundUp[i];
		}
		ans -= max;
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] input = new int[5];
		int[] roundUp = new int[5];
		int max = 0, index = 0, ans = 0;
 
		for(int i = 0; i < 5; i++){
			input[i] = sc.nextInt();
			roundUp[i] = (input[i] + 9) / 10 * 10;
			if(max < roundUp[i] - input[i]){
				max = roundUp[i] - input[i];
				index = i;
			}
		}
		for(int i = 0; i < 5; i++){
			ans += roundUp[i];
		}
		ans -= max;
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int[] input = new int[5];
		int[] roundUp = new int[5];
		int max = 0, index = 0, ans = 0;
 
		for(int i = 0; i < 5; i++){
			input[i] = sc.nextInt();
			roundUp[i] = (input[i] + 9) / 10 * 10;
			if(max < roundUp[i] - input[i]){
				max = roundUp[i] - input[i];
				index = i;
			}
		}
		for(int i = 0; i < 5; i++){
			ans += roundUp[i];
		}
		ans -= max;
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] input = new int[5]; input new int[5] 5 int[] roundUp = new int[5]; roundUp new int[5] 5 int max = 0 max 0 index = 0 index 0 ans = 0; ans 0 for(int i = 0; i < 5; i++){
			input[i] = sc.nextInt();
			roundUp[i] = (input[i] + 9) / 10 * 10;
			if(max < roundUp[i] - input[i]){
				max = roundUp[i] - input[i];
				index = i;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			input[i] = sc.nextInt();
			roundUp[i] = (input[i] + 9) / 10 * 10;
			if(max < roundUp[i] - input[i]){
				max = roundUp[i] - input[i];
				index = i;
			}
		} {
			input[i] = sc.nextInt();
			roundUp[i] = (input[i] + 9) / 10 * 10;
			if(max < roundUp[i] - input[i]){
				max = roundUp[i] - input[i];
				index = i;
			}
		} input[i] = sc.nextInt() input[i] input i sc.nextInt() sc.nextInt sc roundUp[i] = (input[i] + 9) / 10 * 10 roundUp[i] roundUp i (input[i] + 9) / 10 * 10 (input[i] + 9) / 10 (input[i] + 9) input[i] input i 9 10 10 if(max < roundUp[i] - input[i]){
				max = roundUp[i] - input[i];
				index = i;
			} max < roundUp[i] - input[i] max roundUp[i] - input[i] roundUp[i] roundUp i input[i] input i {
				max = roundUp[i] - input[i];
				index = i;
			} max = roundUp[i] - input[i] max roundUp[i] - input[i] roundUp[i] roundUp i input[i] input i index = i index i for(int i = 0; i < 5; i++){
			ans += roundUp[i];
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			ans += roundUp[i];
		} {
			ans += roundUp[i];
		} ans += roundUp[i] ans roundUp[i] roundUp i ans -= max ans max System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] input = new int[5];
		int[] roundUp = new int[5];
		int max = 0, index = 0, ans = 0;
 
		for(int i = 0; i < 5; i++){
			input[i] = sc.nextInt();
			roundUp[i] = (input[i] + 9) / 10 * 10;
			if(max < roundUp[i] - input[i]){
				max = roundUp[i] - input[i];
				index = i;
			}
		}
		for(int i = 0; i < 5; i++){
			ans += roundUp[i];
		}
		ans -= max;
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] input = new int[5];
		int[] roundUp = new int[5];
		int max = 0, index = 0, ans = 0;
 
		for(int i = 0; i < 5; i++){
			input[i] = sc.nextInt();
			roundUp[i] = (input[i] + 9) / 10 * 10;
			if(max < roundUp[i] - input[i]){
				max = roundUp[i] - input[i];
				index = i;
			}
		}
		for(int i = 0; i < 5; i++){
			ans += roundUp[i];
		}
		ans -= max;
		System.out.println(ans);
	}
} Main
import java.util.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] input = new int[5];
		int[] roundUp = new int[5];
		int max = 0, index = 0, ans = 0;
 
		for(int i = 0; i < 5; i++){
			input[i] = sc.nextInt();
			roundUp[i] = (input[i] + 9) / 10 * 10;
			if(max < roundUp[i] - input[i]){
				max = roundUp[i] - input[i];
				index = i;
			}
		}
		for(int i = 0; i < 5; i++){
			ans += roundUp[i];
		}
		ans -= max;
		System.out.println(ans);
	}
}
