import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = new int[5];
		int idx = -1;
		int mm = 10;
		for (int i = 0; i < 5; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < 5; i++) {
			int m = a[i] % 10;
			if (m != 0 && m < mm) {
				idx = i;
				mm = m;
			}
		}

		int ans = 0;
		for (int i = 0; i < 5; i++) {
			if (i == idx) {
				ans += a[i];
			} else {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			}
		}

		out.println(ans);

		sc.close();

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = new int[5];
		int idx = -1;
		int mm = 10;
		for (int i = 0; i < 5; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < 5; i++) {
			int m = a[i] % 10;
			if (m != 0 && m < mm) {
				idx = i;
				mm = m;
			}
		}

		int ans = 0;
		for (int i = 0; i < 5; i++) {
			if (i == idx) {
				ans += a[i];
			} else {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			}
		}

		out.println(ans);

		sc.close();

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} Main InputStream in = System.in; in System.in System System.in PrintStream out = System.out; out System.out System System.out public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = new int[5];
		int idx = -1;
		int mm = 10;
		for (int i = 0; i < 5; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < 5; i++) {
			int m = a[i] % 10;
			if (m != 0 && m < mm) {
				idx = i;
				mm = m;
			}
		}

		int ans = 0;
		for (int i = 0; i < 5; i++) {
			if (i == idx) {
				ans += a[i];
			} else {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			}
		}

		out.println(ans);

		sc.close();

	} _main {
		Scanner sc = new Scanner(in);

		int[] a = new int[5];
		int idx = -1;
		int mm = 10;
		for (int i = 0; i < 5; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < 5; i++) {
			int m = a[i] % 10;
			if (m != 0 && m < mm) {
				idx = i;
				mm = m;
			}
		}

		int ans = 0;
		for (int i = 0; i < 5; i++) {
			if (i == idx) {
				ans += a[i];
			} else {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			}
		}

		out.println(ans);

		sc.close();

	} Scanner sc = new Scanner(in); sc new Scanner(in) int[] a = new int[5]; a new int[5] 5 int idx = -1; idx -1 1 int mm = 10; mm 10 for (int i = 0; i < 5; i++) {
			a[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			a[i] = sc.nextInt();
		} {
			a[i] = sc.nextInt();
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc for (int i = 0; i < 5; i++) {
			int m = a[i] % 10;
			if (m != 0 && m < mm) {
				idx = i;
				mm = m;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			int m = a[i] % 10;
			if (m != 0 && m < mm) {
				idx = i;
				mm = m;
			}
		} {
			int m = a[i] % 10;
			if (m != 0 && m < mm) {
				idx = i;
				mm = m;
			}
		} int m = a[i] % 10; m a[i] % 10 a[i] a i 10 if (m != 0 && m < mm) {
				idx = i;
				mm = m;
			} m != 0 && m < mm m != 0 m 0 m < mm m mm {
				idx = i;
				mm = m;
			} idx = i idx i mm = m mm m int ans = 0; ans 0 for (int i = 0; i < 5; i++) {
			if (i == idx) {
				ans += a[i];
			} else {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if (i == idx) {
				ans += a[i];
			} else {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			}
		} {
			if (i == idx) {
				ans += a[i];
			} else {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			}
		} if (i == idx) {
				ans += a[i];
			} else {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			} i == idx i idx {
				ans += a[i];
			} ans += a[i] ans a[i] a i {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			} ans += (int) (Math.ceil(a[i] / 10.0) * 10) ans (int) (Math.ceil(a[i] / 10.0) * 10) Math.ceil(a[i] / 10.0) Math.ceil Math a[i] / 10.0 a[i] a i 10.0 10 out.println(ans) out.println out ans sc.close() sc.close sc String[] args args public static void main(String[] args) {
		new Main()._main(args);
	} main {
		new Main()._main(args);
	} new Main()._main(args) new Main()._main new Main() args String[] args args public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = new int[5];
		int idx = -1;
		int mm = 10;
		for (int i = 0; i < 5; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < 5; i++) {
			int m = a[i] % 10;
			if (m != 0 && m < mm) {
				idx = i;
				mm = m;
			}
		}

		int ans = 0;
		for (int i = 0; i < 5; i++) {
			if (i == idx) {
				ans += a[i];
			} else {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			}
		}

		out.println(ans);

		sc.close();

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = new int[5];
		int idx = -1;
		int mm = 10;
		for (int i = 0; i < 5; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < 5; i++) {
			int m = a[i] % 10;
			if (m != 0 && m < mm) {
				idx = i;
				mm = m;
			}
		}

		int ans = 0;
		for (int i = 0; i < 5; i++) {
			if (i == idx) {
				ans += a[i];
			} else {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			}
		}

		out.println(ans);

		sc.close();

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = new int[5];
		int idx = -1;
		int mm = 10;
		for (int i = 0; i < 5; i++) {
			a[i] = sc.nextInt();
		}

		for (int i = 0; i < 5; i++) {
			int m = a[i] % 10;
			if (m != 0 && m < mm) {
				idx = i;
				mm = m;
			}
		}

		int ans = 0;
		for (int i = 0; i < 5; i++) {
			if (i == idx) {
				ans += a[i];
			} else {
				ans += (int) (Math.ceil(a[i] / 10.0) * 10);
			}
		}

		out.println(ans);

		sc.close();

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

}
