import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[] lunch=new int[5];
		int[] lunch2=new int[5];

		int sum=0;
		int min=644;

		for(int i=0;i<5;i++) {
			lunch[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++) {
			if(lunch[i]%10==0) {
				lunch2[i]=lunch[i];
			}else {
				lunch2[i]=((lunch[i]/10)+1)*10;
			}
		}

		for(int i=0;i<5;i++) {
			for(int j=0;j<5;j++) {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			}
			//System.out.println(sum);
			if(min>sum) min=sum;
			sum=0;
		}

		System.out.println(min);

		sc.close();

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[] lunch=new int[5];
		int[] lunch2=new int[5];

		int sum=0;
		int min=644;

		for(int i=0;i<5;i++) {
			lunch[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++) {
			if(lunch[i]%10==0) {
				lunch2[i]=lunch[i];
			}else {
				lunch2[i]=((lunch[i]/10)+1)*10;
			}
		}

		for(int i=0;i<5;i++) {
			for(int j=0;j<5;j++) {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			}
			//System.out.println(sum);
			if(min>sum) min=sum;
			sum=0;
		}

		System.out.println(min);

		sc.close();

	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[] lunch=new int[5];
		int[] lunch2=new int[5];

		int sum=0;
		int min=644;

		for(int i=0;i<5;i++) {
			lunch[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++) {
			if(lunch[i]%10==0) {
				lunch2[i]=lunch[i];
			}else {
				lunch2[i]=((lunch[i]/10)+1)*10;
			}
		}

		for(int i=0;i<5;i++) {
			for(int j=0;j<5;j++) {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			}
			//System.out.println(sum);
			if(min>sum) min=sum;
			sum=0;
		}

		System.out.println(min);

		sc.close();

	} main {
		Scanner sc=new Scanner(System.in);
		int[] lunch=new int[5];
		int[] lunch2=new int[5];

		int sum=0;
		int min=644;

		for(int i=0;i<5;i++) {
			lunch[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++) {
			if(lunch[i]%10==0) {
				lunch2[i]=lunch[i];
			}else {
				lunch2[i]=((lunch[i]/10)+1)*10;
			}
		}

		for(int i=0;i<5;i++) {
			for(int j=0;j<5;j++) {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			}
			//System.out.println(sum);
			if(min>sum) min=sum;
			sum=0;
		}

		System.out.println(min);

		sc.close();

	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int[] lunch=new int[5]; lunch new int[5] 5 int[] lunch2=new int[5]; lunch2 new int[5] 5 int sum=0; sum 0 int min=644; min 644 for(int i=0;i<5;i++) {
			lunch[i]=sc.nextInt();
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			lunch[i]=sc.nextInt();
		} {
			lunch[i]=sc.nextInt();
		} lunch[i]=sc.nextInt() lunch[i] lunch i sc.nextInt() sc.nextInt sc for(int i=0;i<5;i++) {
			if(lunch[i]%10==0) {
				lunch2[i]=lunch[i];
			}else {
				lunch2[i]=((lunch[i]/10)+1)*10;
			}
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			if(lunch[i]%10==0) {
				lunch2[i]=lunch[i];
			}else {
				lunch2[i]=((lunch[i]/10)+1)*10;
			}
		} {
			if(lunch[i]%10==0) {
				lunch2[i]=lunch[i];
			}else {
				lunch2[i]=((lunch[i]/10)+1)*10;
			}
		} if(lunch[i]%10==0) {
				lunch2[i]=lunch[i];
			}else {
				lunch2[i]=((lunch[i]/10)+1)*10;
			} lunch[i]%10==0 lunch[i]%10 lunch[i] lunch i 10 0 {
				lunch2[i]=lunch[i];
			} lunch2[i]=lunch[i] lunch2[i] lunch2 i lunch[i] lunch i {
				lunch2[i]=((lunch[i]/10)+1)*10;
			} lunch2[i]=((lunch[i]/10)+1)*10 lunch2[i] lunch2 i ((lunch[i]/10)+1)*10 ((lunch[i]/10)+1) (lunch[i]/10) lunch[i] lunch i 10 1 10 for(int i=0;i<5;i++) {
			for(int j=0;j<5;j++) {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			}
			//System.out.println(sum);
			if(min>sum) min=sum;
			sum=0;
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			for(int j=0;j<5;j++) {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			}
			//System.out.println(sum);
			if(min>sum) min=sum;
			sum=0;
		} {
			for(int j=0;j<5;j++) {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			}
			//System.out.println(sum);
			if(min>sum) min=sum;
			sum=0;
		} for(int j=0;j<5;j++) {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			} int j=0; int j=0; j 0 j<5 j 5 j++ j++ j {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			} {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			} if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				} i==j i j {
					sum+=lunch[j];
				} sum+=lunch[j] sum lunch[j] lunch j {
					sum+=lunch2[j];
				} sum+=lunch2[j] sum lunch2[j] lunch2 j if(min>sum) min=sum; min>sum min sum min=sum min sum sum=0 sum 0 System.out.println(min) System.out.println System.out System System.out min sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[] lunch=new int[5];
		int[] lunch2=new int[5];

		int sum=0;
		int min=644;

		for(int i=0;i<5;i++) {
			lunch[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++) {
			if(lunch[i]%10==0) {
				lunch2[i]=lunch[i];
			}else {
				lunch2[i]=((lunch[i]/10)+1)*10;
			}
		}

		for(int i=0;i<5;i++) {
			for(int j=0;j<5;j++) {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			}
			//System.out.println(sum);
			if(min>sum) min=sum;
			sum=0;
		}

		System.out.println(min);

		sc.close();

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[] lunch=new int[5];
		int[] lunch2=new int[5];

		int sum=0;
		int min=644;

		for(int i=0;i<5;i++) {
			lunch[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++) {
			if(lunch[i]%10==0) {
				lunch2[i]=lunch[i];
			}else {
				lunch2[i]=((lunch[i]/10)+1)*10;
			}
		}

		for(int i=0;i<5;i++) {
			for(int j=0;j<5;j++) {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			}
			//System.out.println(sum);
			if(min>sum) min=sum;
			sum=0;
		}

		System.out.println(min);

		sc.close();

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[] lunch=new int[5];
		int[] lunch2=new int[5];

		int sum=0;
		int min=644;

		for(int i=0;i<5;i++) {
			lunch[i]=sc.nextInt();
		}

		for(int i=0;i<5;i++) {
			if(lunch[i]%10==0) {
				lunch2[i]=lunch[i];
			}else {
				lunch2[i]=((lunch[i]/10)+1)*10;
			}
		}

		for(int i=0;i<5;i++) {
			for(int j=0;j<5;j++) {
				if(i==j) {
					sum+=lunch[j];
				}else {
					sum+=lunch2[j];
				}
			}
			//System.out.println(sum);
			if(min>sum) min=sum;
			sum=0;
		}

		System.out.println(min);

		sc.close();

	}
}
