import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[] arr = new int[5];
		int minIndex = 0;
		int ans = 0;
		for (int i = 0; i < 5; i++) {
			arr[i] = reader.nextInt();
			if (arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0) {
				minIndex = i;
			}
		}
		for (int i = 0; i < 5; i++) {
			if (i == minIndex || arr[i] % 10 == 0) {
				ans += arr[i];
			} else {
				ans += arr[i] / 10 * 10 + 10;
			}
		}

		System.out.print(ans);
		reader.close();
	}
}


 import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[] arr = new int[5];
		int minIndex = 0;
		int ans = 0;
		for (int i = 0; i < 5; i++) {
			arr[i] = reader.nextInt();
			if (arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0) {
				minIndex = i;
			}
		}
		for (int i = 0; i < 5; i++) {
			if (i == minIndex || arr[i] % 10 == 0) {
				ans += arr[i];
			} else {
				ans += arr[i] / 10 * 10 + 10;
			}
		}

		System.out.print(ans);
		reader.close();
	}
} Main public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[] arr = new int[5];
		int minIndex = 0;
		int ans = 0;
		for (int i = 0; i < 5; i++) {
			arr[i] = reader.nextInt();
			if (arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0) {
				minIndex = i;
			}
		}
		for (int i = 0; i < 5; i++) {
			if (i == minIndex || arr[i] % 10 == 0) {
				ans += arr[i];
			} else {
				ans += arr[i] / 10 * 10 + 10;
			}
		}

		System.out.print(ans);
		reader.close();
	} main {
		Scanner reader = new Scanner(System.in);
		int[] arr = new int[5];
		int minIndex = 0;
		int ans = 0;
		for (int i = 0; i < 5; i++) {
			arr[i] = reader.nextInt();
			if (arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0) {
				minIndex = i;
			}
		}
		for (int i = 0; i < 5; i++) {
			if (i == minIndex || arr[i] % 10 == 0) {
				ans += arr[i];
			} else {
				ans += arr[i] / 10 * 10 + 10;
			}
		}

		System.out.print(ans);
		reader.close();
	} Scanner reader = new Scanner(System.in); reader new Scanner(System.in) int[] arr = new int[5]; arr new int[5] 5 int minIndex = 0; minIndex 0 int ans = 0; ans 0 for (int i = 0; i < 5; i++) {
			arr[i] = reader.nextInt();
			if (arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0) {
				minIndex = i;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			arr[i] = reader.nextInt();
			if (arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0) {
				minIndex = i;
			}
		} {
			arr[i] = reader.nextInt();
			if (arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0) {
				minIndex = i;
			}
		} arr[i] = reader.nextInt() arr[i] arr i reader.nextInt() reader.nextInt reader if (arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0) {
				minIndex = i;
			} arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0 arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 arr[minIndex] % 10 > arr[i] % 10 arr[minIndex] % 10 arr[minIndex] arr minIndex 10 arr[i] % 10 arr[i] arr i 10 arr[i] % 10 != 0 arr[i] % 10 arr[i] arr i 10 0 arr[minIndex] % 10 == 0 arr[minIndex] % 10 arr[minIndex] arr minIndex 10 0 {
				minIndex = i;
			} minIndex = i minIndex i for (int i = 0; i < 5; i++) {
			if (i == minIndex || arr[i] % 10 == 0) {
				ans += arr[i];
			} else {
				ans += arr[i] / 10 * 10 + 10;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if (i == minIndex || arr[i] % 10 == 0) {
				ans += arr[i];
			} else {
				ans += arr[i] / 10 * 10 + 10;
			}
		} {
			if (i == minIndex || arr[i] % 10 == 0) {
				ans += arr[i];
			} else {
				ans += arr[i] / 10 * 10 + 10;
			}
		} if (i == minIndex || arr[i] % 10 == 0) {
				ans += arr[i];
			} else {
				ans += arr[i] / 10 * 10 + 10;
			} i == minIndex || arr[i] % 10 == 0 i == minIndex i minIndex arr[i] % 10 == 0 arr[i] % 10 arr[i] arr i 10 0 {
				ans += arr[i];
			} ans += arr[i] ans arr[i] arr i {
				ans += arr[i] / 10 * 10 + 10;
			} ans += arr[i] / 10 * 10 + 10 ans arr[i] / 10 * 10 + 10 arr[i] / 10 * 10 arr[i] / 10 arr[i] arr i 10 10 10 System.out.print(ans) System.out.print System.out System System.out ans reader.close() reader.close reader String[] args args public class Main {

	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[] arr = new int[5];
		int minIndex = 0;
		int ans = 0;
		for (int i = 0; i < 5; i++) {
			arr[i] = reader.nextInt();
			if (arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0) {
				minIndex = i;
			}
		}
		for (int i = 0; i < 5; i++) {
			if (i == minIndex || arr[i] % 10 == 0) {
				ans += arr[i];
			} else {
				ans += arr[i] / 10 * 10 + 10;
			}
		}

		System.out.print(ans);
		reader.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[] arr = new int[5];
		int minIndex = 0;
		int ans = 0;
		for (int i = 0; i < 5; i++) {
			arr[i] = reader.nextInt();
			if (arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0) {
				minIndex = i;
			}
		}
		for (int i = 0; i < 5; i++) {
			if (i == minIndex || arr[i] % 10 == 0) {
				ans += arr[i];
			} else {
				ans += arr[i] / 10 * 10 + 10;
			}
		}

		System.out.print(ans);
		reader.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[] arr = new int[5];
		int minIndex = 0;
		int ans = 0;
		for (int i = 0; i < 5; i++) {
			arr[i] = reader.nextInt();
			if (arr[minIndex] % 10 > arr[i] % 10 && arr[i] % 10 != 0 || arr[minIndex] % 10 == 0) {
				minIndex = i;
			}
		}
		for (int i = 0; i < 5; i++) {
			if (i == minIndex || arr[i] % 10 == 0) {
				ans += arr[i];
			} else {
				ans += arr[i] / 10 * 10 + 10;
			}
		}

		System.out.print(ans);
		reader.close();
	}
}



