import java.util.Scanner;

public class Main {
	void run() {
		int sum = 0, min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		for (int i = 0; i < 5; i++) {
			int n = scan.nextInt();
			sum += Math.ceil((double) n / 10) * 10;
			if (n % 10 != 0)
				min = Math.min(min, n % 10);
		}
		if (min == Integer.MAX_VALUE)
			System.out.println(sum);
		else
			System.out.println(sum - 10 + min);
	}
    public static void main(String[] args) {
    	new Main().run();
    }
} import java.util.Scanner; Scanner java.util public class Main {
	void run() {
		int sum = 0, min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		for (int i = 0; i < 5; i++) {
			int n = scan.nextInt();
			sum += Math.ceil((double) n / 10) * 10;
			if (n % 10 != 0)
				min = Math.min(min, n % 10);
		}
		if (min == Integer.MAX_VALUE)
			System.out.println(sum);
		else
			System.out.println(sum - 10 + min);
	}
    public static void main(String[] args) {
    	new Main().run();
    }
} Main void run() {
		int sum = 0, min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		for (int i = 0; i < 5; i++) {
			int n = scan.nextInt();
			sum += Math.ceil((double) n / 10) * 10;
			if (n % 10 != 0)
				min = Math.min(min, n % 10);
		}
		if (min == Integer.MAX_VALUE)
			System.out.println(sum);
		else
			System.out.println(sum - 10 + min);
	} run {
		int sum = 0, min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		for (int i = 0; i < 5; i++) {
			int n = scan.nextInt();
			sum += Math.ceil((double) n / 10) * 10;
			if (n % 10 != 0)
				min = Math.min(min, n % 10);
		}
		if (min == Integer.MAX_VALUE)
			System.out.println(sum);
		else
			System.out.println(sum - 10 + min);
	} int sum = 0 sum 0 min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE Scanner scan = new Scanner(System.in); scan new Scanner(System.in) for (int i = 0; i < 5; i++) {
			int n = scan.nextInt();
			sum += Math.ceil((double) n / 10) * 10;
			if (n % 10 != 0)
				min = Math.min(min, n % 10);
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			int n = scan.nextInt();
			sum += Math.ceil((double) n / 10) * 10;
			if (n % 10 != 0)
				min = Math.min(min, n % 10);
		} {
			int n = scan.nextInt();
			sum += Math.ceil((double) n / 10) * 10;
			if (n % 10 != 0)
				min = Math.min(min, n % 10);
		} int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan sum += Math.ceil((double) n / 10) * 10 sum Math.ceil((double) n / 10) * 10 Math.ceil((double) n / 10) Math.ceil Math (double) n / 10 (double) n 10 10 if (n % 10 != 0)
				min = Math.min(min, n % 10); n % 10 != 0 n % 10 n 10 0 min = Math.min(min, n % 10) min Math.min(min, n % 10) Math.min Math min n % 10 n 10 if (min == Integer.MAX_VALUE)
			System.out.println(sum);
		else
			System.out.println(sum - 10 + min); min == Integer.MAX_VALUE min Integer.MAX_VALUE Integer Integer.MAX_VALUE System.out.println(sum) System.out.println System.out System System.out sum System.out.println(sum - 10 + min) System.out.println System.out System System.out sum - 10 + min sum - 10 sum 10 min public static void main(String[] args) {
    	new Main().run();
    } main {
    	new Main().run();
    } new Main().run() new Main().run new Main() String[] args args public class Main {
	void run() {
		int sum = 0, min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		for (int i = 0; i < 5; i++) {
			int n = scan.nextInt();
			sum += Math.ceil((double) n / 10) * 10;
			if (n % 10 != 0)
				min = Math.min(min, n % 10);
		}
		if (min == Integer.MAX_VALUE)
			System.out.println(sum);
		else
			System.out.println(sum - 10 + min);
	}
    public static void main(String[] args) {
    	new Main().run();
    }
} public class Main {
	void run() {
		int sum = 0, min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		for (int i = 0; i < 5; i++) {
			int n = scan.nextInt();
			sum += Math.ceil((double) n / 10) * 10;
			if (n % 10 != 0)
				min = Math.min(min, n % 10);
		}
		if (min == Integer.MAX_VALUE)
			System.out.println(sum);
		else
			System.out.println(sum - 10 + min);
	}
    public static void main(String[] args) {
    	new Main().run();
    }
} Main
import java.util.Scanner;

public class Main {
	void run() {
		int sum = 0, min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		for (int i = 0; i < 5; i++) {
			int n = scan.nextInt();
			sum += Math.ceil((double) n / 10) * 10;
			if (n % 10 != 0)
				min = Math.min(min, n % 10);
		}
		if (min == Integer.MAX_VALUE)
			System.out.println(sum);
		else
			System.out.println(sum - 10 + min);
	}
    public static void main(String[] args) {
    	new Main().run();
    }
}
