import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int[] times = new int[5];
		for(int i = 0; i < times.length; i++) 
			times[i] = sc.nextInt();
		
		int min = 0;
		for(int i = 1; i < times.length; i++) 
			if(mod(times[min]) > mod(times[i]))
				min = i;
		
		int sum = 0;
		for(int i =0; i < times.length; i++)
			if(i == min)
				sum += times[i];
			else
				sum += roundUp(times[i]);
		System.out.println(sum);
	}
	
	private static int roundUp(int i) {
		if(i % 10 == 0)
			return i;
		return (i / 10 + 1) * 10;
	}
	
	private static int mod(int i) {
		if(i % 10 == 0)
			return 10;
		else
			return i % 10;
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int[] times = new int[5];
		for(int i = 0; i < times.length; i++) 
			times[i] = sc.nextInt();
		
		int min = 0;
		for(int i = 1; i < times.length; i++) 
			if(mod(times[min]) > mod(times[i]))
				min = i;
		
		int sum = 0;
		for(int i =0; i < times.length; i++)
			if(i == min)
				sum += times[i];
			else
				sum += roundUp(times[i]);
		System.out.println(sum);
	}
	
	private static int roundUp(int i) {
		if(i % 10 == 0)
			return i;
		return (i / 10 + 1) * 10;
	}
	
	private static int mod(int i) {
		if(i % 10 == 0)
			return 10;
		else
			return i % 10;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int[] times = new int[5];
		for(int i = 0; i < times.length; i++) 
			times[i] = sc.nextInt();
		
		int min = 0;
		for(int i = 1; i < times.length; i++) 
			if(mod(times[min]) > mod(times[i]))
				min = i;
		
		int sum = 0;
		for(int i =0; i < times.length; i++)
			if(i == min)
				sum += times[i];
			else
				sum += roundUp(times[i]);
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		
		int[] times = new int[5];
		for(int i = 0; i < times.length; i++) 
			times[i] = sc.nextInt();
		
		int min = 0;
		for(int i = 1; i < times.length; i++) 
			if(mod(times[min]) > mod(times[i]))
				min = i;
		
		int sum = 0;
		for(int i =0; i < times.length; i++)
			if(i == min)
				sum += times[i];
			else
				sum += roundUp(times[i]);
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] times = new int[5]; times new int[5] 5 for(int i = 0; i < times.length; i++) 
			times[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < times.length i times.length times times.length i++ i++ i times[i] = sc.nextInt(); times[i] = sc.nextInt() times[i] times i sc.nextInt() sc.nextInt sc int min = 0; min 0 for(int i = 1; i < times.length; i++) 
			if(mod(times[min]) > mod(times[i]))
				min = i; int i = 1; int i = 1; i 1 i < times.length i times.length times times.length i++ i++ i if(mod(times[min]) > mod(times[i]))
				min = i; if(mod(times[min]) > mod(times[i]))
				min = i; mod(times[min]) > mod(times[i]) mod(times[min]) mod times[min] times min mod(times[i]) mod times[i] times i min = i min i int sum = 0; sum 0 for(int i =0; i < times.length; i++)
			if(i == min)
				sum += times[i];
			else
				sum += roundUp(times[i]); int i =0; int i =0; i 0 i < times.length i times.length times times.length i++ i++ i if(i == min)
				sum += times[i];
			else
				sum += roundUp(times[i]); if(i == min)
				sum += times[i];
			else
				sum += roundUp(times[i]); i == min i min sum += times[i] sum times[i] times i sum += roundUp(times[i]) sum roundUp(times[i]) roundUp times[i] times i System.out.println(sum) System.out.println System.out System System.out sum String[] args args private static int roundUp(int i) {
		if(i % 10 == 0)
			return i;
		return (i / 10 + 1) * 10;
	} roundUp {
		if(i % 10 == 0)
			return i;
		return (i / 10 + 1) * 10;
	} if(i % 10 == 0)
			return i; i % 10 == 0 i % 10 i 10 0 return i; i return (i / 10 + 1) * 10; (i / 10 + 1) * 10 (i / 10 + 1) i / 10 i 10 1 10 int i i private static int mod(int i) {
		if(i % 10 == 0)
			return 10;
		else
			return i % 10;
	} mod {
		if(i % 10 == 0)
			return 10;
		else
			return i % 10;
	} if(i % 10 == 0)
			return 10;
		else
			return i % 10; i % 10 == 0 i % 10 i 10 0 return 10; 10 return i % 10; i % 10 i 10 int i i public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int[] times = new int[5];
		for(int i = 0; i < times.length; i++) 
			times[i] = sc.nextInt();
		
		int min = 0;
		for(int i = 1; i < times.length; i++) 
			if(mod(times[min]) > mod(times[i]))
				min = i;
		
		int sum = 0;
		for(int i =0; i < times.length; i++)
			if(i == min)
				sum += times[i];
			else
				sum += roundUp(times[i]);
		System.out.println(sum);
	}
	
	private static int roundUp(int i) {
		if(i % 10 == 0)
			return i;
		return (i / 10 + 1) * 10;
	}
	
	private static int mod(int i) {
		if(i % 10 == 0)
			return 10;
		else
			return i % 10;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int[] times = new int[5];
		for(int i = 0; i < times.length; i++) 
			times[i] = sc.nextInt();
		
		int min = 0;
		for(int i = 1; i < times.length; i++) 
			if(mod(times[min]) > mod(times[i]))
				min = i;
		
		int sum = 0;
		for(int i =0; i < times.length; i++)
			if(i == min)
				sum += times[i];
			else
				sum += roundUp(times[i]);
		System.out.println(sum);
	}
	
	private static int roundUp(int i) {
		if(i % 10 == 0)
			return i;
		return (i / 10 + 1) * 10;
	}
	
	private static int mod(int i) {
		if(i % 10 == 0)
			return 10;
		else
			return i % 10;
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int[] times = new int[5];
		for(int i = 0; i < times.length; i++) 
			times[i] = sc.nextInt();
		
		int min = 0;
		for(int i = 1; i < times.length; i++) 
			if(mod(times[min]) > mod(times[i]))
				min = i;
		
		int sum = 0;
		for(int i =0; i < times.length; i++)
			if(i == min)
				sum += times[i];
			else
				sum += roundUp(times[i]);
		System.out.println(sum);
	}
	
	private static int roundUp(int i) {
		if(i % 10 == 0)
			return i;
		return (i / 10 + 1) * 10;
	}
	
	private static int mod(int i) {
		if(i % 10 == 0)
			return 10;
		else
			return i % 10;
	}
}