import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] menu = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};
		sc.close();

		int ans = 0;

		int min = 10;
		int minIdx = 0;
		for (int i = 0; i < 5; i++) {
			int digit = menu[i] % 10;
			if (digit != 0 && digit < min) {
				min = digit;
				minIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i != minIdx) {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			}
		}

		ans += menu[minIdx];
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] menu = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};
		sc.close();

		int ans = 0;

		int min = 10;
		int minIdx = 0;
		for (int i = 0; i < 5; i++) {
			int digit = menu[i] % 10;
			if (digit != 0 && digit < min) {
				min = digit;
				minIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i != minIdx) {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			}
		}

		ans += menu[minIdx];
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] menu = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};
		sc.close();

		int ans = 0;

		int min = 10;
		int minIdx = 0;
		for (int i = 0; i < 5; i++) {
			int digit = menu[i] % 10;
			if (digit != 0 && digit < min) {
				min = digit;
				minIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i != minIdx) {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			}
		}

		ans += menu[minIdx];
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int[] menu = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};
		sc.close();

		int ans = 0;

		int min = 10;
		int minIdx = 0;
		for (int i = 0; i < 5; i++) {
			int digit = menu[i] % 10;
			if (digit != 0 && digit < min) {
				min = digit;
				minIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i != minIdx) {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			}
		}

		ans += menu[minIdx];
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] menu = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()}; menu new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()} sc.close() sc.close sc int ans = 0; ans 0 int min = 10; min 10 int minIdx = 0; minIdx 0 for (int i = 0; i < 5; i++) {
			int digit = menu[i] % 10;
			if (digit != 0 && digit < min) {
				min = digit;
				minIdx = i;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			int digit = menu[i] % 10;
			if (digit != 0 && digit < min) {
				min = digit;
				minIdx = i;
			}
		} {
			int digit = menu[i] % 10;
			if (digit != 0 && digit < min) {
				min = digit;
				minIdx = i;
			}
		} int digit = menu[i] % 10; digit menu[i] % 10 menu[i] menu i 10 if (digit != 0 && digit < min) {
				min = digit;
				minIdx = i;
			} digit != 0 && digit < min digit != 0 digit 0 digit < min digit min {
				min = digit;
				minIdx = i;
			} min = digit min digit minIdx = i minIdx i for (int i = 0; i < 5; i++) {
			if (i != minIdx) {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if (i != minIdx) {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			}
		} {
			if (i != minIdx) {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			}
		} if (i != minIdx) {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			} i != minIdx i minIdx {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			} ans += menu[i] ans menu[i] menu i if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				} ans % 10 != 0 ans % 10 ans 10 0 {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				} ans = (int) Math.ceil(ans / 10.0) * 10 ans (int) Math.ceil(ans / 10.0) * 10 (int) Math.ceil(ans / 10.0) Math.ceil Math ans / 10.0 ans 10.0 10 ans += menu[minIdx] ans menu[minIdx] menu minIdx System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] menu = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};
		sc.close();

		int ans = 0;

		int min = 10;
		int minIdx = 0;
		for (int i = 0; i < 5; i++) {
			int digit = menu[i] % 10;
			if (digit != 0 && digit < min) {
				min = digit;
				minIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i != minIdx) {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			}
		}

		ans += menu[minIdx];
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] menu = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};
		sc.close();

		int ans = 0;

		int min = 10;
		int minIdx = 0;
		for (int i = 0; i < 5; i++) {
			int digit = menu[i] % 10;
			if (digit != 0 && digit < min) {
				min = digit;
				minIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i != minIdx) {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			}
		}

		ans += menu[minIdx];
		System.out.println(ans);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] menu = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};
		sc.close();

		int ans = 0;

		int min = 10;
		int minIdx = 0;
		for (int i = 0; i < 5; i++) {
			int digit = menu[i] % 10;
			if (digit != 0 && digit < min) {
				min = digit;
				minIdx = i;
			}
		}

		for (int i = 0; i < 5; i++) {
			if (i != minIdx) {
				ans += menu[i];
				if (ans % 10 != 0) {
					ans = (int) Math.ceil(ans / 10.0) * 10;
				}
			}
		}

		ans += menu[minIdx];
		System.out.println(ans);
	}
}
