import java.util.Scanner;

public class Main {
	private static Scanner sc;

	public static void main(String[] args) throws Exception {
		sc = new Scanner(System.in);
		double[] ary = new double[5];
		for (int i = 0; i < 5; i++) {
			ary[i] = sc.nextInt();

		}

		for (int i = 0; i < ary.length - 1; i++) {
			if (ary[i] % 10 == 0) {
				continue;
			}
			if (ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10) {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			}

		}

		double a = 0;

		for (int i = 0; i < ary.length; i++) {
			if (i == ary.length - 1) {
				a += ary[i];
			} else {

				a += Math.ceil(ary[i] / 10) * 10;
			}

		}

		System.out.println(String.format("%.0f", a));

	}

} import java.util.Scanner; Scanner java.util public class Main {
	private static Scanner sc;

	public static void main(String[] args) throws Exception {
		sc = new Scanner(System.in);
		double[] ary = new double[5];
		for (int i = 0; i < 5; i++) {
			ary[i] = sc.nextInt();

		}

		for (int i = 0; i < ary.length - 1; i++) {
			if (ary[i] % 10 == 0) {
				continue;
			}
			if (ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10) {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			}

		}

		double a = 0;

		for (int i = 0; i < ary.length; i++) {
			if (i == ary.length - 1) {
				a += ary[i];
			} else {

				a += Math.ceil(ary[i] / 10) * 10;
			}

		}

		System.out.println(String.format("%.0f", a));

	}

} Main private static Scanner sc; sc public static void main(String[] args) throws Exception {
		sc = new Scanner(System.in);
		double[] ary = new double[5];
		for (int i = 0; i < 5; i++) {
			ary[i] = sc.nextInt();

		}

		for (int i = 0; i < ary.length - 1; i++) {
			if (ary[i] % 10 == 0) {
				continue;
			}
			if (ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10) {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			}

		}

		double a = 0;

		for (int i = 0; i < ary.length; i++) {
			if (i == ary.length - 1) {
				a += ary[i];
			} else {

				a += Math.ceil(ary[i] / 10) * 10;
			}

		}

		System.out.println(String.format("%.0f", a));

	} main {
		sc = new Scanner(System.in);
		double[] ary = new double[5];
		for (int i = 0; i < 5; i++) {
			ary[i] = sc.nextInt();

		}

		for (int i = 0; i < ary.length - 1; i++) {
			if (ary[i] % 10 == 0) {
				continue;
			}
			if (ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10) {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			}

		}

		double a = 0;

		for (int i = 0; i < ary.length; i++) {
			if (i == ary.length - 1) {
				a += ary[i];
			} else {

				a += Math.ceil(ary[i] / 10) * 10;
			}

		}

		System.out.println(String.format("%.0f", a));

	} sc = new Scanner(System.in) sc new Scanner(System.in) double[] ary = new double[5]; ary new double[5] 5 for (int i = 0; i < 5; i++) {
			ary[i] = sc.nextInt();

		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			ary[i] = sc.nextInt();

		} {
			ary[i] = sc.nextInt();

		} ary[i] = sc.nextInt() ary[i] ary i sc.nextInt() sc.nextInt sc for (int i = 0; i < ary.length - 1; i++) {
			if (ary[i] % 10 == 0) {
				continue;
			}
			if (ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10) {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			}

		} int i = 0; int i = 0; i 0 i < ary.length - 1 i ary.length - 1 ary.length ary ary.length 1 i++ i++ i {
			if (ary[i] % 10 == 0) {
				continue;
			}
			if (ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10) {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			}

		} {
			if (ary[i] % 10 == 0) {
				continue;
			}
			if (ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10) {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			}

		} if (ary[i] % 10 == 0) {
				continue;
			} ary[i] % 10 == 0 ary[i] % 10 ary[i] ary i 10 0 {
				continue;
			} continue; if (ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10) {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			} ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10 ary[ary.length - 1] % 10 == 0 ary[ary.length - 1] % 10 ary[ary.length - 1] ary ary.length - 1 ary.length ary ary.length 1 10 0 ary[ary.length - 1] % 10 > ary[i] % 10 ary[ary.length - 1] % 10 ary[ary.length - 1] ary ary.length - 1 ary.length ary ary.length 1 10 ary[i] % 10 ary[i] ary i 10 {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			} double tmp = ary[ary.length - 1]; tmp ary[ary.length - 1] ary ary.length - 1 ary.length ary ary.length 1 ary[ary.length - 1] = ary[i] ary[ary.length - 1] ary ary.length - 1 ary.length ary ary.length 1 ary[i] ary i ary[i] = tmp ary[i] ary i tmp double a = 0; a 0 for (int i = 0; i < ary.length; i++) {
			if (i == ary.length - 1) {
				a += ary[i];
			} else {

				a += Math.ceil(ary[i] / 10) * 10;
			}

		} int i = 0; int i = 0; i 0 i < ary.length i ary.length ary ary.length i++ i++ i {
			if (i == ary.length - 1) {
				a += ary[i];
			} else {

				a += Math.ceil(ary[i] / 10) * 10;
			}

		} {
			if (i == ary.length - 1) {
				a += ary[i];
			} else {

				a += Math.ceil(ary[i] / 10) * 10;
			}

		} if (i == ary.length - 1) {
				a += ary[i];
			} else {

				a += Math.ceil(ary[i] / 10) * 10;
			} i == ary.length - 1 i ary.length - 1 ary.length ary ary.length 1 {
				a += ary[i];
			} a += ary[i] a ary[i] ary i {

				a += Math.ceil(ary[i] / 10) * 10;
			} a += Math.ceil(ary[i] / 10) * 10 a Math.ceil(ary[i] / 10) * 10 Math.ceil(ary[i] / 10) Math.ceil Math ary[i] / 10 ary[i] ary i 10 10 System.out.println(String.format("%.0f", a)) System.out.println System.out System System.out String.format("%.0f", a) String.format String "%.0f" a String[] args args public class Main {
	private static Scanner sc;

	public static void main(String[] args) throws Exception {
		sc = new Scanner(System.in);
		double[] ary = new double[5];
		for (int i = 0; i < 5; i++) {
			ary[i] = sc.nextInt();

		}

		for (int i = 0; i < ary.length - 1; i++) {
			if (ary[i] % 10 == 0) {
				continue;
			}
			if (ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10) {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			}

		}

		double a = 0;

		for (int i = 0; i < ary.length; i++) {
			if (i == ary.length - 1) {
				a += ary[i];
			} else {

				a += Math.ceil(ary[i] / 10) * 10;
			}

		}

		System.out.println(String.format("%.0f", a));

	}

} public class Main {
	private static Scanner sc;

	public static void main(String[] args) throws Exception {
		sc = new Scanner(System.in);
		double[] ary = new double[5];
		for (int i = 0; i < 5; i++) {
			ary[i] = sc.nextInt();

		}

		for (int i = 0; i < ary.length - 1; i++) {
			if (ary[i] % 10 == 0) {
				continue;
			}
			if (ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10) {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			}

		}

		double a = 0;

		for (int i = 0; i < ary.length; i++) {
			if (i == ary.length - 1) {
				a += ary[i];
			} else {

				a += Math.ceil(ary[i] / 10) * 10;
			}

		}

		System.out.println(String.format("%.0f", a));

	}

} Main
import java.util.Scanner;

public class Main {
	private static Scanner sc;

	public static void main(String[] args) throws Exception {
		sc = new Scanner(System.in);
		double[] ary = new double[5];
		for (int i = 0; i < 5; i++) {
			ary[i] = sc.nextInt();

		}

		for (int i = 0; i < ary.length - 1; i++) {
			if (ary[i] % 10 == 0) {
				continue;
			}
			if (ary[ary.length - 1] % 10 == 0 || ary[ary.length - 1] % 10 > ary[i] % 10) {
				double tmp = ary[ary.length - 1];
				ary[ary.length - 1] = ary[i];
				ary[i] = tmp;
			}

		}

		double a = 0;

		for (int i = 0; i < ary.length; i++) {
			if (i == ary.length - 1) {
				a += ary[i];
			} else {

				a += Math.ceil(ary[i] / 10) * 10;
			}

		}

		System.out.println(String.format("%.0f", a));

	}

}