import java.util.Arrays;
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] dishes = new int[5];
		int sum = 0;
		for(int i = 0; i < 5; i++) {
			dishes[i] = sc.nextInt();
			sum += dishes[i];
			dishes[i] = (10 - (dishes[i] % 10)) % 10;
		}
		Arrays.sort(dishes);
		for(int i = 0; i < 4; i++) {
			sum += dishes[i];
		}
		System.out.println(sum);
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] dishes = new int[5];
		int sum = 0;
		for(int i = 0; i < 5; i++) {
			dishes[i] = sc.nextInt();
			sum += dishes[i];
			dishes[i] = (10 - (dishes[i] % 10)) % 10;
		}
		Arrays.sort(dishes);
		for(int i = 0; i < 4; i++) {
			sum += dishes[i];
		}
		System.out.println(sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] dishes = new int[5];
		int sum = 0;
		for(int i = 0; i < 5; i++) {
			dishes[i] = sc.nextInt();
			sum += dishes[i];
			dishes[i] = (10 - (dishes[i] % 10)) % 10;
		}
		Arrays.sort(dishes);
		for(int i = 0; i < 4; i++) {
			sum += dishes[i];
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int[] dishes = new int[5];
		int sum = 0;
		for(int i = 0; i < 5; i++) {
			dishes[i] = sc.nextInt();
			sum += dishes[i];
			dishes[i] = (10 - (dishes[i] % 10)) % 10;
		}
		Arrays.sort(dishes);
		for(int i = 0; i < 4; i++) {
			sum += dishes[i];
		}
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] dishes = new int[5]; dishes new int[5] 5 int sum = 0; sum 0 for(int i = 0; i < 5; i++) {
			dishes[i] = sc.nextInt();
			sum += dishes[i];
			dishes[i] = (10 - (dishes[i] % 10)) % 10;
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			dishes[i] = sc.nextInt();
			sum += dishes[i];
			dishes[i] = (10 - (dishes[i] % 10)) % 10;
		} {
			dishes[i] = sc.nextInt();
			sum += dishes[i];
			dishes[i] = (10 - (dishes[i] % 10)) % 10;
		} dishes[i] = sc.nextInt() dishes[i] dishes i sc.nextInt() sc.nextInt sc sum += dishes[i] sum dishes[i] dishes i dishes[i] = (10 - (dishes[i] % 10)) % 10 dishes[i] dishes i (10 - (dishes[i] % 10)) % 10 (10 - (dishes[i] % 10)) 10 (dishes[i] % 10) dishes[i] dishes i 10 10 Arrays.sort(dishes) Arrays.sort Arrays dishes for(int i = 0; i < 4; i++) {
			sum += dishes[i];
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			sum += dishes[i];
		} {
			sum += dishes[i];
		} sum += dishes[i] sum dishes[i] dishes i System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.Arrays;
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] dishes = new int[5];
		int sum = 0;
		for(int i = 0; i < 5; i++) {
			dishes[i] = sc.nextInt();
			sum += dishes[i];
			dishes[i] = (10 - (dishes[i] % 10)) % 10;
		}
		Arrays.sort(dishes);
		for(int i = 0; i < 4; i++) {
			sum += dishes[i];
		}
		System.out.println(sum);
	}
}