import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int div = 0;
		for (int i = 0; i < 5; i++) {
			int input = sc.nextInt();
			if (input % 10 == 0) {
				sum += input;
			} else {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			}
		}
		if(div == 0) {
			System.out.println(sum);
		}else {
			System.out.println(sum + div - 10);
		}
		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 sum = 0;
		int div = 0;
		for (int i = 0; i < 5; i++) {
			int input = sc.nextInt();
			if (input % 10 == 0) {
				sum += input;
			} else {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			}
		}
		if(div == 0) {
			System.out.println(sum);
		}else {
			System.out.println(sum + div - 10);
		}
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int div = 0;
		for (int i = 0; i < 5; i++) {
			int input = sc.nextInt();
			if (input % 10 == 0) {
				sum += input;
			} else {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			}
		}
		if(div == 0) {
			System.out.println(sum);
		}else {
			System.out.println(sum + div - 10);
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int div = 0;
		for (int i = 0; i < 5; i++) {
			int input = sc.nextInt();
			if (input % 10 == 0) {
				sum += input;
			} else {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			}
		}
		if(div == 0) {
			System.out.println(sum);
		}else {
			System.out.println(sum + div - 10);
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int sum = 0; sum 0 int div = 0; div 0 for (int i = 0; i < 5; i++) {
			int input = sc.nextInt();
			if (input % 10 == 0) {
				sum += input;
			} else {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			int input = sc.nextInt();
			if (input % 10 == 0) {
				sum += input;
			} else {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			}
		} {
			int input = sc.nextInt();
			if (input % 10 == 0) {
				sum += input;
			} else {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			}
		} int input = sc.nextInt(); input sc.nextInt() sc.nextInt sc if (input % 10 == 0) {
				sum += input;
			} else {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			} input % 10 == 0 input % 10 input 10 0 {
				sum += input;
			} sum += input sum input {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			} int nowdiv = input % 10; nowdiv input % 10 input 10 sum += input - nowdiv + 10 sum input - nowdiv + 10 input - nowdiv input nowdiv 10 if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				} div == 0 div 0 {
					div = nowdiv;
				} div = nowdiv div nowdiv {
					if (div > nowdiv) {
						div = nowdiv;
					}
				} if (div > nowdiv) {
						div = nowdiv;
					} div > nowdiv div nowdiv {
						div = nowdiv;
					} div = nowdiv div nowdiv if(div == 0) {
			System.out.println(sum);
		}else {
			System.out.println(sum + div - 10);
		} div == 0 div 0 {
			System.out.println(sum);
		} System.out.println(sum) System.out.println System.out System System.out sum {
			System.out.println(sum + div - 10);
		} System.out.println(sum + div - 10) System.out.println System.out System System.out sum + div - 10 sum + div sum div 10 sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int div = 0;
		for (int i = 0; i < 5; i++) {
			int input = sc.nextInt();
			if (input % 10 == 0) {
				sum += input;
			} else {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			}
		}
		if(div == 0) {
			System.out.println(sum);
		}else {
			System.out.println(sum + div - 10);
		}
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int div = 0;
		for (int i = 0; i < 5; i++) {
			int input = sc.nextInt();
			if (input % 10 == 0) {
				sum += input;
			} else {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			}
		}
		if(div == 0) {
			System.out.println(sum);
		}else {
			System.out.println(sum + div - 10);
		}
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int div = 0;
		for (int i = 0; i < 5; i++) {
			int input = sc.nextInt();
			if (input % 10 == 0) {
				sum += input;
			} else {
				int nowdiv = input % 10;
				sum += input - nowdiv + 10;
				if (div == 0) {
					div = nowdiv;
				} else {
					if (div > nowdiv) {
						div = nowdiv;
					}
				}
			}
		}
		if(div == 0) {
			System.out.println(sum);
		}else {
			System.out.println(sum + div - 10);
		}
		sc.close();
	}
}
