import java.util.Scanner;
public class Main {
	@SuppressWarnings({ "resource"})
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int[] point=new int[5];
		int tmp=0,total=0;
		for(int i=0;i<5;i++){
			point[i]=scanner.nextInt();
			}
		for(int j=0;j<4;j++) {
			for(int i=0;i<4;i++) {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			}
		}
		for(int i=0;i<4;i++) {
			total+=point[i];
			if(point[i]%10!=0) {
				total+=10-(point[i]%10);
			}
		}
		total+=point[4];
System.out.println(total);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	@SuppressWarnings({ "resource"})
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int[] point=new int[5];
		int tmp=0,total=0;
		for(int i=0;i<5;i++){
			point[i]=scanner.nextInt();
			}
		for(int j=0;j<4;j++) {
			for(int i=0;i<4;i++) {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			}
		}
		for(int i=0;i<4;i++) {
			total+=point[i];
			if(point[i]%10!=0) {
				total+=10-(point[i]%10);
			}
		}
		total+=point[4];
System.out.println(total);
	}
} Main @SuppressWarnings({ "resource"})
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int[] point=new int[5];
		int tmp=0,total=0;
		for(int i=0;i<5;i++){
			point[i]=scanner.nextInt();
			}
		for(int j=0;j<4;j++) {
			for(int i=0;i<4;i++) {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			}
		}
		for(int i=0;i<4;i++) {
			total+=point[i];
			if(point[i]%10!=0) {
				total+=10-(point[i]%10);
			}
		}
		total+=point[4];
System.out.println(total);
	} main {
		Scanner scanner=new Scanner(System.in);
		int[] point=new int[5];
		int tmp=0,total=0;
		for(int i=0;i<5;i++){
			point[i]=scanner.nextInt();
			}
		for(int j=0;j<4;j++) {
			for(int i=0;i<4;i++) {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			}
		}
		for(int i=0;i<4;i++) {
			total+=point[i];
			if(point[i]%10!=0) {
				total+=10-(point[i]%10);
			}
		}
		total+=point[4];
System.out.println(total);
	} Scanner scanner=new Scanner(System.in); scanner new Scanner(System.in) int[] point=new int[5]; point new int[5] 5 int tmp=0 tmp 0 total=0; total 0 for(int i=0;i<5;i++){
			point[i]=scanner.nextInt();
			} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			point[i]=scanner.nextInt();
			} {
			point[i]=scanner.nextInt();
			} point[i]=scanner.nextInt() point[i] point i scanner.nextInt() scanner.nextInt scanner for(int j=0;j<4;j++) {
			for(int i=0;i<4;i++) {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			}
		} int j=0; int j=0; j 0 j<4 j 4 j++ j++ j {
			for(int i=0;i<4;i++) {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			}
		} {
			for(int i=0;i<4;i++) {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			}
		} for(int i=0;i<4;i++) {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			} int i=0; int i=0; i 0 i<4 i 4 i++ i++ i {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			} {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			} if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				} (point[i]%10<point[i+1]%10)||(point[i+1]%10==0) (point[i]%10<point[i+1]%10) point[i]%10 point[i] point i 10 point[i+1]%10 point[i+1] point i+1 i 1 10 (point[i+1]%10==0) point[i+1]%10 point[i+1] point i+1 i 1 10 0 {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				} tmp=point[i] tmp point[i] point i point[i]=point[i+1] point[i] point i point[i+1] point i+1 i 1 point[i+1]=tmp point[i+1] point i+1 i 1 tmp for(int i=0;i<4;i++) {
			total+=point[i];
			if(point[i]%10!=0) {
				total+=10-(point[i]%10);
			}
		} int i=0; int i=0; i 0 i<4 i 4 i++ i++ i {
			total+=point[i];
			if(point[i]%10!=0) {
				total+=10-(point[i]%10);
			}
		} {
			total+=point[i];
			if(point[i]%10!=0) {
				total+=10-(point[i]%10);
			}
		} total+=point[i] total point[i] point i if(point[i]%10!=0) {
				total+=10-(point[i]%10);
			} point[i]%10!=0 point[i]%10 point[i] point i 10 0 {
				total+=10-(point[i]%10);
			} total+=10-(point[i]%10) total 10-(point[i]%10) 10 (point[i]%10) point[i] point i 10 total+=point[4] total point[4] point 4 System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
	@SuppressWarnings({ "resource"})
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int[] point=new int[5];
		int tmp=0,total=0;
		for(int i=0;i<5;i++){
			point[i]=scanner.nextInt();
			}
		for(int j=0;j<4;j++) {
			for(int i=0;i<4;i++) {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			}
		}
		for(int i=0;i<4;i++) {
			total+=point[i];
			if(point[i]%10!=0) {
				total+=10-(point[i]%10);
			}
		}
		total+=point[4];
System.out.println(total);
	}
} public class Main {
	@SuppressWarnings({ "resource"})
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int[] point=new int[5];
		int tmp=0,total=0;
		for(int i=0;i<5;i++){
			point[i]=scanner.nextInt();
			}
		for(int j=0;j<4;j++) {
			for(int i=0;i<4;i++) {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			}
		}
		for(int i=0;i<4;i++) {
			total+=point[i];
			if(point[i]%10!=0) {
				total+=10-(point[i]%10);
			}
		}
		total+=point[4];
System.out.println(total);
	}
} Main
import java.util.Scanner;
public class Main {
	@SuppressWarnings({ "resource"})
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int[] point=new int[5];
		int tmp=0,total=0;
		for(int i=0;i<5;i++){
			point[i]=scanner.nextInt();
			}
		for(int j=0;j<4;j++) {
			for(int i=0;i<4;i++) {
				if((point[i]%10<point[i+1]%10)||(point[i+1]%10==0)) {
					tmp=point[i];
					point[i]=point[i+1];
					point[i+1]=tmp;
				}

			}
		}
		for(int i=0;i<4;i++) {
			total+=point[i];
			if(point[i]%10!=0) {
				total+=10-(point[i]%10);
			}
		}
		total+=point[4];
System.out.println(total);
	}
}