import java.util.*;
class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] times = new int[5];
		int min = 123, ans = 0, sum = 0;

		for(int i=0; i<times.length; i++){
			times[i] = sc.nextInt();
			if((times[i]%10<min) && (times[i]%10!=0)){
				min = times[i]%10;
				ans = i;
			}
		}

		for(int i=0; i<times.length; i++){
			int sub = (times[i] / 10 + 1) * 10;
			if((i == ans) || (times[i]%10 == 0)){
				sum += times[i];
			}else{
				sum += sub;
			}
		}
		System.out.println(sum);
		// System.out.println("min = "+ans+"\nsum = "+sum+"\nans = "+ans);
	}
} import java.util.*; util.* java class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] times = new int[5];
		int min = 123, ans = 0, sum = 0;

		for(int i=0; i<times.length; i++){
			times[i] = sc.nextInt();
			if((times[i]%10<min) && (times[i]%10!=0)){
				min = times[i]%10;
				ans = i;
			}
		}

		for(int i=0; i<times.length; i++){
			int sub = (times[i] / 10 + 1) * 10;
			if((i == ans) || (times[i]%10 == 0)){
				sum += times[i];
			}else{
				sum += sub;
			}
		}
		System.out.println(sum);
		// System.out.println("min = "+ans+"\nsum = "+sum+"\nans = "+ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] times = new int[5];
		int min = 123, ans = 0, sum = 0;

		for(int i=0; i<times.length; i++){
			times[i] = sc.nextInt();
			if((times[i]%10<min) && (times[i]%10!=0)){
				min = times[i]%10;
				ans = i;
			}
		}

		for(int i=0; i<times.length; i++){
			int sub = (times[i] / 10 + 1) * 10;
			if((i == ans) || (times[i]%10 == 0)){
				sum += times[i];
			}else{
				sum += sub;
			}
		}
		System.out.println(sum);
		// System.out.println("min = "+ans+"\nsum = "+sum+"\nans = "+ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int[] times = new int[5];
		int min = 123, ans = 0, sum = 0;

		for(int i=0; i<times.length; i++){
			times[i] = sc.nextInt();
			if((times[i]%10<min) && (times[i]%10!=0)){
				min = times[i]%10;
				ans = i;
			}
		}

		for(int i=0; i<times.length; i++){
			int sub = (times[i] / 10 + 1) * 10;
			if((i == ans) || (times[i]%10 == 0)){
				sum += times[i];
			}else{
				sum += sub;
			}
		}
		System.out.println(sum);
		// System.out.println("min = "+ans+"\nsum = "+sum+"\nans = "+ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] times = new int[5]; times new int[5] 5 int min = 123 min 123 ans = 0 ans 0 sum = 0; sum 0 for(int i=0; i<times.length; i++){
			times[i] = sc.nextInt();
			if((times[i]%10<min) && (times[i]%10!=0)){
				min = times[i]%10;
				ans = i;
			}
		} int i=0; int i=0; i 0 i<times.length i times.length times times.length i++ i++ i {
			times[i] = sc.nextInt();
			if((times[i]%10<min) && (times[i]%10!=0)){
				min = times[i]%10;
				ans = i;
			}
		} {
			times[i] = sc.nextInt();
			if((times[i]%10<min) && (times[i]%10!=0)){
				min = times[i]%10;
				ans = i;
			}
		} times[i] = sc.nextInt() times[i] times i sc.nextInt() sc.nextInt sc if((times[i]%10<min) && (times[i]%10!=0)){
				min = times[i]%10;
				ans = i;
			} (times[i]%10<min) && (times[i]%10!=0) (times[i]%10<min) times[i]%10 times[i] times i 10 min (times[i]%10!=0) times[i]%10 times[i] times i 10 0 {
				min = times[i]%10;
				ans = i;
			} min = times[i]%10 min times[i]%10 times[i] times i 10 ans = i ans i for(int i=0; i<times.length; i++){
			int sub = (times[i] / 10 + 1) * 10;
			if((i == ans) || (times[i]%10 == 0)){
				sum += times[i];
			}else{
				sum += sub;
			}
		} int i=0; int i=0; i 0 i<times.length i times.length times times.length i++ i++ i {
			int sub = (times[i] / 10 + 1) * 10;
			if((i == ans) || (times[i]%10 == 0)){
				sum += times[i];
			}else{
				sum += sub;
			}
		} {
			int sub = (times[i] / 10 + 1) * 10;
			if((i == ans) || (times[i]%10 == 0)){
				sum += times[i];
			}else{
				sum += sub;
			}
		} int sub = (times[i] / 10 + 1) * 10; sub (times[i] / 10 + 1) * 10 (times[i] / 10 + 1) times[i] / 10 times[i] times i 10 1 10 if((i == ans) || (times[i]%10 == 0)){
				sum += times[i];
			}else{
				sum += sub;
			} (i == ans) || (times[i]%10 == 0) (i == ans) i ans (times[i]%10 == 0) times[i]%10 times[i] times i 10 0 {
				sum += times[i];
			} sum += times[i] sum times[i] times i {
				sum += sub;
			} sum += sub sum sub System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.*;
class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] times = new int[5];
		int min = 123, ans = 0, sum = 0;

		for(int i=0; i<times.length; i++){
			times[i] = sc.nextInt();
			if((times[i]%10<min) && (times[i]%10!=0)){
				min = times[i]%10;
				ans = i;
			}
		}

		for(int i=0; i<times.length; i++){
			int sub = (times[i] / 10 + 1) * 10;
			if((i == ans) || (times[i]%10 == 0)){
				sum += times[i];
			}else{
				sum += sub;
			}
		}
		System.out.println(sum);
		// System.out.println("min = "+ans+"\nsum = "+sum+"\nans = "+ans);
	}
}