import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int[] abcde = new int[5];
		for (int i = 0; i < 5; i++) {
			abcde[i] = sc.nextInt();
		}

		Permutation np = new Permutation(5);
		int min = Integer.MAX_VALUE;
		for (List<Integer> perm : np) {
			int tmp = 0;
			for (int i = 0; i < 4; i++) {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			}
			
			tmp += abcde[perm.get(4)];
			min = Math.min(min, tmp);
		}

		pr.println(min);
	}

	private static class Permutation implements Iterable<List<Integer>>{
		int n;
		long nn;

		Permutation(int n) {
			this.n = n;

			nn = 1;
			for (int i = 2; i <= n; i++) {
				nn *= i;
			}
		}

		@Override
		public Iterator<List<Integer>> iterator() {
			return new PermutationIterator();
		}

		private class PermutationIterator implements Iterator<List<Integer>> {
			boolean[] used;
			List<Integer> perm;
			Deque<Integer> ist;
			long cnt = 0;

			PermutationIterator() {
				used = new boolean[n];
				perm = new ArrayList<Integer>(n);
				ist = new ArrayDeque<Integer>();
				ist.add(-1);
			}

			@Override
			public boolean hasNext() {
				return cnt < nn;
			}

			@Override
			public List<Integer> next() {
				out:
				while (!ist.isEmpty()) {
					int k = ist.pop();

					if (k != -1) {
						// ループ途中での戻り
						used[k] = false;
						perm.remove(perm.size() - 1);
					} else {
						// 最初から
						int pos = perm.size();

						if (pos == n) {
							cnt++;
							// perm に対する操作 =========================
							return perm;
							// perm に対する操作 =========================
						}
					}

					for (int i = k + 1; i < n; i++) {
						if (!used[i]) {
							ist.push(i);

							used[i] = true;
							perm.add(i);
							ist.push(-1);
							continue out;
						}
					}
				}

				return null;
			}

		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int[] abcde = new int[5];
		for (int i = 0; i < 5; i++) {
			abcde[i] = sc.nextInt();
		}

		Permutation np = new Permutation(5);
		int min = Integer.MAX_VALUE;
		for (List<Integer> perm : np) {
			int tmp = 0;
			for (int i = 0; i < 4; i++) {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			}
			
			tmp += abcde[perm.get(4)];
			min = Math.min(min, tmp);
		}

		pr.println(min);
	}

	private static class Permutation implements Iterable<List<Integer>>{
		int n;
		long nn;

		Permutation(int n) {
			this.n = n;

			nn = 1;
			for (int i = 2; i <= n; i++) {
				nn *= i;
			}
		}

		@Override
		public Iterator<List<Integer>> iterator() {
			return new PermutationIterator();
		}

		private class PermutationIterator implements Iterator<List<Integer>> {
			boolean[] used;
			List<Integer> perm;
			Deque<Integer> ist;
			long cnt = 0;

			PermutationIterator() {
				used = new boolean[n];
				perm = new ArrayList<Integer>(n);
				ist = new ArrayDeque<Integer>();
				ist.add(-1);
			}

			@Override
			public boolean hasNext() {
				return cnt < nn;
			}

			@Override
			public List<Integer> next() {
				out:
				while (!ist.isEmpty()) {
					int k = ist.pop();

					if (k != -1) {
						// ループ途中での戻り
						used[k] = false;
						perm.remove(perm.size() - 1);
					} else {
						// 最初から
						int pos = perm.size();

						if (pos == n) {
							cnt++;
							// perm に対する操作 =========================
							return perm;
							// perm に対する操作 =========================
						}
					}

					for (int i = k + 1; i < n; i++) {
						if (!used[i]) {
							ist.push(i);

							used[i] = true;
							perm.add(i);
							ist.push(-1);
							continue out;
						}
					}
				}

				return null;
			}

		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main private static Scanner sc; sc private static Printer pr; pr private static void solve() {
		int[] abcde = new int[5];
		for (int i = 0; i < 5; i++) {
			abcde[i] = sc.nextInt();
		}

		Permutation np = new Permutation(5);
		int min = Integer.MAX_VALUE;
		for (List<Integer> perm : np) {
			int tmp = 0;
			for (int i = 0; i < 4; i++) {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			}
			
			tmp += abcde[perm.get(4)];
			min = Math.min(min, tmp);
		}

		pr.println(min);
	} solve {
		int[] abcde = new int[5];
		for (int i = 0; i < 5; i++) {
			abcde[i] = sc.nextInt();
		}

		Permutation np = new Permutation(5);
		int min = Integer.MAX_VALUE;
		for (List<Integer> perm : np) {
			int tmp = 0;
			for (int i = 0; i < 4; i++) {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			}
			
			tmp += abcde[perm.get(4)];
			min = Math.min(min, tmp);
		}

		pr.println(min);
	} int[] abcde = new int[5]; abcde new int[5] 5 for (int i = 0; i < 5; i++) {
			abcde[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			abcde[i] = sc.nextInt();
		} {
			abcde[i] = sc.nextInt();
		} abcde[i] = sc.nextInt() abcde[i] abcde i sc.nextInt() sc.nextInt sc Permutation np = new Permutation(5); np new Permutation(5) int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (List<Integer> perm : np) {
			int tmp = 0;
			for (int i = 0; i < 4; i++) {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			}
			
			tmp += abcde[perm.get(4)];
			min = Math.min(min, tmp);
		} List<Integer> perm np {
			int tmp = 0;
			for (int i = 0; i < 4; i++) {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			}
			
			tmp += abcde[perm.get(4)];
			min = Math.min(min, tmp);
		} {
			int tmp = 0;
			for (int i = 0; i < 4; i++) {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			}
			
			tmp += abcde[perm.get(4)];
			min = Math.min(min, tmp);
		} int tmp = 0; tmp 0 for (int i = 0; i < 4; i++) {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			} {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			} tmp += (abcde[perm.get(i)] + 9) / 10 * 10 tmp (abcde[perm.get(i)] + 9) / 10 * 10 (abcde[perm.get(i)] + 9) / 10 (abcde[perm.get(i)] + 9) abcde[perm.get(i)] abcde perm.get(i) perm.get perm i 9 10 10 tmp += abcde[perm.get(4)] tmp abcde[perm.get(4)] abcde perm.get(4) perm.get perm 4 min = Math.min(min, tmp) min Math.min(min, tmp) Math.min Math min tmp pr.println(min) pr.println pr min // ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	} main {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	} sc = new Scanner(System.in) sc new Scanner(System.in) pr = new Printer(System.out) pr new Printer(System.out) solve() solve pr.close() pr.close pr sc.close() sc.close sc String[] args args private static class Permutation implements Iterable<List<Integer>>{
		int n;
		long nn;

		Permutation(int n) {
			this.n = n;

			nn = 1;
			for (int i = 2; i <= n; i++) {
				nn *= i;
			}
		}

		@Override
		public Iterator<List<Integer>> iterator() {
			return new PermutationIterator();
		}

		private class PermutationIterator implements Iterator<List<Integer>> {
			boolean[] used;
			List<Integer> perm;
			Deque<Integer> ist;
			long cnt = 0;

			PermutationIterator() {
				used = new boolean[n];
				perm = new ArrayList<Integer>(n);
				ist = new ArrayDeque<Integer>();
				ist.add(-1);
			}

			@Override
			public boolean hasNext() {
				return cnt < nn;
			}

			@Override
			public List<Integer> next() {
				out:
				while (!ist.isEmpty()) {
					int k = ist.pop();

					if (k != -1) {
						// ループ途中での戻り
						used[k] = false;
						perm.remove(perm.size() - 1);
					} else {
						// 最初から
						int pos = perm.size();

						if (pos == n) {
							cnt++;
							// perm に対する操作 =========================
							return perm;
							// perm に対する操作 =========================
						}
					}

					for (int i = k + 1; i < n; i++) {
						if (!used[i]) {
							ist.push(i);

							used[i] = true;
							perm.add(i);
							ist.push(-1);
							continue out;
						}
					}
				}

				return null;
			}

		}
	} Permutation int n; n long nn; nn Permutation(int n) {
			this.n = n;

			nn = 1;
			for (int i = 2; i <= n; i++) {
				nn *= i;
			}
		} Permutation {
			this.n = n;

			nn = 1;
			for (int i = 2; i <= n; i++) {
				nn *= i;
			}
		} this.n = n this.n this this.n n nn = 1 nn 1 for (int i = 2; i <= n; i++) {
				nn *= i;
			} int i = 2; int i = 2; i 2 i <= n i n i++ i++ i {
				nn *= i;
			} {
				nn *= i;
			} nn *= i nn i int n n @Override
		public Iterator<List<Integer>> iterator() {
			return new PermutationIterator();
		} iterator {
			return new PermutationIterator();
		} return new PermutationIterator(); new PermutationIterator() private class PermutationIterator implements Iterator<List<Integer>> {
			boolean[] used;
			List<Integer> perm;
			Deque<Integer> ist;
			long cnt = 0;

			PermutationIterator() {
				used = new boolean[n];
				perm = new ArrayList<Integer>(n);
				ist = new ArrayDeque<Integer>();
				ist.add(-1);
			}

			@Override
			public boolean hasNext() {
				return cnt < nn;
			}

			@Override
			public List<Integer> next() {
				out:
				while (!ist.isEmpty()) {
					int k = ist.pop();

					if (k != -1) {
						// ループ途中での戻り
						used[k] = false;
						perm.remove(perm.size() - 1);
					} else {
						// 最初から
						int pos = perm.size();

						if (pos == n) {
							cnt++;
							// perm に対する操作 =========================
							return perm;
							// perm に対する操作 =========================
						}
					}

					for (int i = k + 1; i < n; i++) {
						if (!used[i]) {
							ist.push(i);

							used[i] = true;
							perm.add(i);
							ist.push(-1);
							continue out;
						}
					}
				}

				return null;
			}

		} PermutationIterator boolean[] used; used List<Integer> perm; perm Deque<Integer> ist; ist long cnt = 0; cnt 0 PermutationIterator() {
				used = new boolean[n];
				perm = new ArrayList<Integer>(n);
				ist = new ArrayDeque<Integer>();
				ist.add(-1);
			} PermutationIterator {
				used = new boolean[n];
				perm = new ArrayList<Integer>(n);
				ist = new ArrayDeque<Integer>();
				ist.add(-1);
			} used = new boolean[n] used new boolean[n] n perm = new ArrayList<Integer>(n) perm new ArrayList<Integer>(n) ist = new ArrayDeque<Integer>() ist new ArrayDeque<Integer>() ist.add(-1) ist.add ist -1 1 @Override
			public boolean hasNext() {
				return cnt < nn;
			} hasNext {
				return cnt < nn;
			} return cnt < nn; cnt < nn cnt nn @Override
			public List<Integer> next() {
				out:
				while (!ist.isEmpty()) {
					int k = ist.pop();

					if (k != -1) {
						// ループ途中での戻り
						used[k] = false;
						perm.remove(perm.size() - 1);
					} else {
						// 最初から
						int pos = perm.size();

						if (pos == n) {
							cnt++;
							// perm に対する操作 =========================
							return perm;
							// perm に対する操作 =========================
						}
					}

					for (int i = k + 1; i < n; i++) {
						if (!used[i]) {
							ist.push(i);

							used[i] = true;
							perm.add(i);
							ist.push(-1);
							continue out;
						}
					}
				}

				return null;
			} next {
				out:
				while (!ist.isEmpty()) {
					int k = ist.pop();

					if (k != -1) {
						// ループ途中での戻り
						used[k] = false;
						perm.remove(perm.size() - 1);
					} else {
						// 最初から
						int pos = perm.size();

						if (pos == n) {
							cnt++;
							// perm に対する操作 =========================
							return perm;
							// perm に対する操作 =========================
						}
					}

					for (int i = k + 1; i < n; i++) {
						if (!used[i]) {
							ist.push(i);

							used[i] = true;
							perm.add(i);
							ist.push(-1);
							continue out;
						}
					}
				}

				return null;
			} return null; null Iterator Iterable static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	} Printer Printer(OutputStream out) {
			super(out);
		} Printer {
			super(out);
		} super(out) super out OutputStream out out PrintWriter public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int[] abcde = new int[5];
		for (int i = 0; i < 5; i++) {
			abcde[i] = sc.nextInt();
		}

		Permutation np = new Permutation(5);
		int min = Integer.MAX_VALUE;
		for (List<Integer> perm : np) {
			int tmp = 0;
			for (int i = 0; i < 4; i++) {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			}
			
			tmp += abcde[perm.get(4)];
			min = Math.min(min, tmp);
		}

		pr.println(min);
	}

	private static class Permutation implements Iterable<List<Integer>>{
		int n;
		long nn;

		Permutation(int n) {
			this.n = n;

			nn = 1;
			for (int i = 2; i <= n; i++) {
				nn *= i;
			}
		}

		@Override
		public Iterator<List<Integer>> iterator() {
			return new PermutationIterator();
		}

		private class PermutationIterator implements Iterator<List<Integer>> {
			boolean[] used;
			List<Integer> perm;
			Deque<Integer> ist;
			long cnt = 0;

			PermutationIterator() {
				used = new boolean[n];
				perm = new ArrayList<Integer>(n);
				ist = new ArrayDeque<Integer>();
				ist.add(-1);
			}

			@Override
			public boolean hasNext() {
				return cnt < nn;
			}

			@Override
			public List<Integer> next() {
				out:
				while (!ist.isEmpty()) {
					int k = ist.pop();

					if (k != -1) {
						// ループ途中での戻り
						used[k] = false;
						perm.remove(perm.size() - 1);
					} else {
						// 最初から
						int pos = perm.size();

						if (pos == n) {
							cnt++;
							// perm に対する操作 =========================
							return perm;
							// perm に対する操作 =========================
						}
					}

					for (int i = k + 1; i < n; i++) {
						if (!used[i]) {
							ist.push(i);

							used[i] = true;
							perm.add(i);
							ist.push(-1);
							continue out;
						}
					}
				}

				return null;
			}

		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int[] abcde = new int[5];
		for (int i = 0; i < 5; i++) {
			abcde[i] = sc.nextInt();
		}

		Permutation np = new Permutation(5);
		int min = Integer.MAX_VALUE;
		for (List<Integer> perm : np) {
			int tmp = 0;
			for (int i = 0; i < 4; i++) {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			}
			
			tmp += abcde[perm.get(4)];
			min = Math.min(min, tmp);
		}

		pr.println(min);
	}

	private static class Permutation implements Iterable<List<Integer>>{
		int n;
		long nn;

		Permutation(int n) {
			this.n = n;

			nn = 1;
			for (int i = 2; i <= n; i++) {
				nn *= i;
			}
		}

		@Override
		public Iterator<List<Integer>> iterator() {
			return new PermutationIterator();
		}

		private class PermutationIterator implements Iterator<List<Integer>> {
			boolean[] used;
			List<Integer> perm;
			Deque<Integer> ist;
			long cnt = 0;

			PermutationIterator() {
				used = new boolean[n];
				perm = new ArrayList<Integer>(n);
				ist = new ArrayDeque<Integer>();
				ist.add(-1);
			}

			@Override
			public boolean hasNext() {
				return cnt < nn;
			}

			@Override
			public List<Integer> next() {
				out:
				while (!ist.isEmpty()) {
					int k = ist.pop();

					if (k != -1) {
						// ループ途中での戻り
						used[k] = false;
						perm.remove(perm.size() - 1);
					} else {
						// 最初から
						int pos = perm.size();

						if (pos == n) {
							cnt++;
							// perm に対する操作 =========================
							return perm;
							// perm に対する操作 =========================
						}
					}

					for (int i = k + 1; i < n; i++) {
						if (!used[i]) {
							ist.push(i);

							used[i] = true;
							perm.add(i);
							ist.push(-1);
							continue out;
						}
					}
				}

				return null;
			}

		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main
import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int[] abcde = new int[5];
		for (int i = 0; i < 5; i++) {
			abcde[i] = sc.nextInt();
		}

		Permutation np = new Permutation(5);
		int min = Integer.MAX_VALUE;
		for (List<Integer> perm : np) {
			int tmp = 0;
			for (int i = 0; i < 4; i++) {
				tmp += (abcde[perm.get(i)] + 9) / 10 * 10;
			}
			
			tmp += abcde[perm.get(4)];
			min = Math.min(min, tmp);
		}

		pr.println(min);
	}

	private static class Permutation implements Iterable<List<Integer>>{
		int n;
		long nn;

		Permutation(int n) {
			this.n = n;

			nn = 1;
			for (int i = 2; i <= n; i++) {
				nn *= i;
			}
		}

		@Override
		public Iterator<List<Integer>> iterator() {
			return new PermutationIterator();
		}

		private class PermutationIterator implements Iterator<List<Integer>> {
			boolean[] used;
			List<Integer> perm;
			Deque<Integer> ist;
			long cnt = 0;

			PermutationIterator() {
				used = new boolean[n];
				perm = new ArrayList<Integer>(n);
				ist = new ArrayDeque<Integer>();
				ist.add(-1);
			}

			@Override
			public boolean hasNext() {
				return cnt < nn;
			}

			@Override
			public List<Integer> next() {
				out:
				while (!ist.isEmpty()) {
					int k = ist.pop();

					if (k != -1) {
						// ループ途中での戻り
						used[k] = false;
						perm.remove(perm.size() - 1);
					} else {
						// 最初から
						int pos = perm.size();

						if (pos == n) {
							cnt++;
							// perm に対する操作 =========================
							return perm;
							// perm に対する操作 =========================
						}
					}

					for (int i = k + 1; i < n; i++) {
						if (!used[i]) {
							ist.push(i);

							used[i] = true;
							perm.add(i);
							ist.push(-1);
							continue out;
						}
					}
				}

				return null;
			}

		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
