import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = 5;
		int[] a = new int[n];
		int min = 10;
		int minIndex = -1;
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sc.next());
			if (a[i] % 10 != 0 && min > a[i] % 10) {
				min = a[i] % 10;
				minIndex = i;
			}
		}
		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += kiriage(a[i]);
		}
		if (minIndex != -1) {
			sum -= kiriage(a[minIndex]);
			sum += a[minIndex];
		}
		System.out.println(sum);
	}

	static int kiriage(int num) {
		if (num % 10 == 0) {
			return num;
		}
		return num / 10 * 10 + 10;
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = 5;
		int[] a = new int[n];
		int min = 10;
		int minIndex = -1;
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sc.next());
			if (a[i] % 10 != 0 && min > a[i] % 10) {
				min = a[i] % 10;
				minIndex = i;
			}
		}
		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += kiriage(a[i]);
		}
		if (minIndex != -1) {
			sum -= kiriage(a[minIndex]);
			sum += a[minIndex];
		}
		System.out.println(sum);
	}

	static int kiriage(int num) {
		if (num % 10 == 0) {
			return num;
		}
		return num / 10 * 10 + 10;
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = 5;
		int[] a = new int[n];
		int min = 10;
		int minIndex = -1;
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sc.next());
			if (a[i] % 10 != 0 && min > a[i] % 10) {
				min = a[i] % 10;
				minIndex = i;
			}
		}
		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += kiriage(a[i]);
		}
		if (minIndex != -1) {
			sum -= kiriage(a[minIndex]);
			sum += a[minIndex];
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = 5;
		int[] a = new int[n];
		int min = 10;
		int minIndex = -1;
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sc.next());
			if (a[i] % 10 != 0 && min > a[i] % 10) {
				min = a[i] % 10;
				minIndex = i;
			}
		}
		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += kiriage(a[i]);
		}
		if (minIndex != -1) {
			sum -= kiriage(a[minIndex]);
			sum += a[minIndex];
		}
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = 5; n 5 int[] a = new int[n]; a new int[n] n int min = 10; min 10 int minIndex = -1; minIndex -1 1 for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sc.next());
			if (a[i] % 10 != 0 && min > a[i] % 10) {
				min = a[i] % 10;
				minIndex = i;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = Integer.parseInt(sc.next());
			if (a[i] % 10 != 0 && min > a[i] % 10) {
				min = a[i] % 10;
				minIndex = i;
			}
		} {
			a[i] = Integer.parseInt(sc.next());
			if (a[i] % 10 != 0 && min > a[i] % 10) {
				min = a[i] % 10;
				minIndex = i;
			}
		} a[i] = Integer.parseInt(sc.next()) a[i] a i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if (a[i] % 10 != 0 && min > a[i] % 10) {
				min = a[i] % 10;
				minIndex = i;
			} a[i] % 10 != 0 && min > a[i] % 10 a[i] % 10 != 0 a[i] % 10 a[i] a i 10 0 min > a[i] % 10 min a[i] % 10 a[i] a i 10 {
				min = a[i] % 10;
				minIndex = i;
			} min = a[i] % 10 min a[i] % 10 a[i] a i 10 minIndex = i minIndex i int sum = 0; sum 0 for (int i = 0; i < n; i++) {
			sum += kiriage(a[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			sum += kiriage(a[i]);
		} {
			sum += kiriage(a[i]);
		} sum += kiriage(a[i]) sum kiriage(a[i]) kiriage a[i] a i if (minIndex != -1) {
			sum -= kiriage(a[minIndex]);
			sum += a[minIndex];
		} minIndex != -1 minIndex -1 1 {
			sum -= kiriage(a[minIndex]);
			sum += a[minIndex];
		} sum -= kiriage(a[minIndex]) sum kiriage(a[minIndex]) kiriage a[minIndex] a minIndex sum += a[minIndex] sum a[minIndex] a minIndex System.out.println(sum) System.out.println System.out System System.out sum String[] args args static int kiriage(int num) {
		if (num % 10 == 0) {
			return num;
		}
		return num / 10 * 10 + 10;
	} kiriage {
		if (num % 10 == 0) {
			return num;
		}
		return num / 10 * 10 + 10;
	} if (num % 10 == 0) {
			return num;
		} num % 10 == 0 num % 10 num 10 0 {
			return num;
		} return num; num return num / 10 * 10 + 10; num / 10 * 10 + 10 num / 10 * 10 num / 10 num 10 10 10 int num num public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = 5;
		int[] a = new int[n];
		int min = 10;
		int minIndex = -1;
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sc.next());
			if (a[i] % 10 != 0 && min > a[i] % 10) {
				min = a[i] % 10;
				minIndex = i;
			}
		}
		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += kiriage(a[i]);
		}
		if (minIndex != -1) {
			sum -= kiriage(a[minIndex]);
			sum += a[minIndex];
		}
		System.out.println(sum);
	}

	static int kiriage(int num) {
		if (num % 10 == 0) {
			return num;
		}
		return num / 10 * 10 + 10;
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = 5;
		int[] a = new int[n];
		int min = 10;
		int minIndex = -1;
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sc.next());
			if (a[i] % 10 != 0 && min > a[i] % 10) {
				min = a[i] % 10;
				minIndex = i;
			}
		}
		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += kiriage(a[i]);
		}
		if (minIndex != -1) {
			sum -= kiriage(a[minIndex]);
			sum += a[minIndex];
		}
		System.out.println(sum);
	}

	static int kiriage(int num) {
		if (num % 10 == 0) {
			return num;
		}
		return num / 10 * 10 + 10;
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = 5;
		int[] a = new int[n];
		int min = 10;
		int minIndex = -1;
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sc.next());
			if (a[i] % 10 != 0 && min > a[i] % 10) {
				min = a[i] % 10;
				minIndex = i;
			}
		}
		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += kiriage(a[i]);
		}
		if (minIndex != -1) {
			sum -= kiriage(a[minIndex]);
			sum += a[minIndex];
		}
		System.out.println(sum);
	}

	static int kiriage(int num) {
		if (num % 10 == 0) {
			return num;
		}
		return num / 10 * 10 + 10;
	}

}
