import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int e = Integer.parseInt(sc.next());
		int min = 10;
		if (a % 10 != 0) {
			if (a % 10 < min) {
				min = a % 10;
			}
			a = a / 10 * 10 + 10;
		}
		if (b % 10 != 0) {
			if (b % 10 < min) {
				min = b % 10;
			}
			b = b / 10 * 10 + 10;
		}
		if (c % 10 != 0) {
			if (c % 10 < min) {
				min = c % 10;
			}
			c = c / 10 * 10 + 10;
		}
		if (d % 10 != 0) {
			if (d % 10 < min) {
				min = d % 10;
			}
			d = d / 10 * 10 + 10;
		}
		if (e % 10 != 0) {
			if (e % 10 < min) {
				min = e % 10;
			}
			e = e / 10 * 10 + 10;
		}
		int ans = a + b + c + d + e - 10 + min;
		System.out.println(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int e = Integer.parseInt(sc.next());
		int min = 10;
		if (a % 10 != 0) {
			if (a % 10 < min) {
				min = a % 10;
			}
			a = a / 10 * 10 + 10;
		}
		if (b % 10 != 0) {
			if (b % 10 < min) {
				min = b % 10;
			}
			b = b / 10 * 10 + 10;
		}
		if (c % 10 != 0) {
			if (c % 10 < min) {
				min = c % 10;
			}
			c = c / 10 * 10 + 10;
		}
		if (d % 10 != 0) {
			if (d % 10 < min) {
				min = d % 10;
			}
			d = d / 10 * 10 + 10;
		}
		if (e % 10 != 0) {
			if (e % 10 < min) {
				min = e % 10;
			}
			e = e / 10 * 10 + 10;
		}
		int ans = a + b + c + d + e - 10 + min;
		System.out.println(ans);
		sc.close();
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int e = Integer.parseInt(sc.next());
		int min = 10;
		if (a % 10 != 0) {
			if (a % 10 < min) {
				min = a % 10;
			}
			a = a / 10 * 10 + 10;
		}
		if (b % 10 != 0) {
			if (b % 10 < min) {
				min = b % 10;
			}
			b = b / 10 * 10 + 10;
		}
		if (c % 10 != 0) {
			if (c % 10 < min) {
				min = c % 10;
			}
			c = c / 10 * 10 + 10;
		}
		if (d % 10 != 0) {
			if (d % 10 < min) {
				min = d % 10;
			}
			d = d / 10 * 10 + 10;
		}
		if (e % 10 != 0) {
			if (e % 10 < min) {
				min = e % 10;
			}
			e = e / 10 * 10 + 10;
		}
		int ans = a + b + c + d + e - 10 + min;
		System.out.println(ans);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int e = Integer.parseInt(sc.next());
		int min = 10;
		if (a % 10 != 0) {
			if (a % 10 < min) {
				min = a % 10;
			}
			a = a / 10 * 10 + 10;
		}
		if (b % 10 != 0) {
			if (b % 10 < min) {
				min = b % 10;
			}
			b = b / 10 * 10 + 10;
		}
		if (c % 10 != 0) {
			if (c % 10 < min) {
				min = c % 10;
			}
			c = c / 10 * 10 + 10;
		}
		if (d % 10 != 0) {
			if (d % 10 < min) {
				min = d % 10;
			}
			d = d / 10 * 10 + 10;
		}
		if (e % 10 != 0) {
			if (e % 10 < min) {
				min = e % 10;
			}
			e = e / 10 * 10 + 10;
		}
		int ans = a + b + c + d + e - 10 + min;
		System.out.println(ans);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c = Integer.parseInt(sc.next()); c Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int d = Integer.parseInt(sc.next()); d Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int e = Integer.parseInt(sc.next()); e Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int min = 10; min 10 if (a % 10 != 0) {
			if (a % 10 < min) {
				min = a % 10;
			}
			a = a / 10 * 10 + 10;
		} a % 10 != 0 a % 10 a 10 0 {
			if (a % 10 < min) {
				min = a % 10;
			}
			a = a / 10 * 10 + 10;
		} if (a % 10 < min) {
				min = a % 10;
			} a % 10 < min a % 10 a 10 min {
				min = a % 10;
			} min = a % 10 min a % 10 a 10 a = a / 10 * 10 + 10 a a / 10 * 10 + 10 a / 10 * 10 a / 10 a 10 10 10 if (b % 10 != 0) {
			if (b % 10 < min) {
				min = b % 10;
			}
			b = b / 10 * 10 + 10;
		} b % 10 != 0 b % 10 b 10 0 {
			if (b % 10 < min) {
				min = b % 10;
			}
			b = b / 10 * 10 + 10;
		} if (b % 10 < min) {
				min = b % 10;
			} b % 10 < min b % 10 b 10 min {
				min = b % 10;
			} min = b % 10 min b % 10 b 10 b = b / 10 * 10 + 10 b b / 10 * 10 + 10 b / 10 * 10 b / 10 b 10 10 10 if (c % 10 != 0) {
			if (c % 10 < min) {
				min = c % 10;
			}
			c = c / 10 * 10 + 10;
		} c % 10 != 0 c % 10 c 10 0 {
			if (c % 10 < min) {
				min = c % 10;
			}
			c = c / 10 * 10 + 10;
		} if (c % 10 < min) {
				min = c % 10;
			} c % 10 < min c % 10 c 10 min {
				min = c % 10;
			} min = c % 10 min c % 10 c 10 c = c / 10 * 10 + 10 c c / 10 * 10 + 10 c / 10 * 10 c / 10 c 10 10 10 if (d % 10 != 0) {
			if (d % 10 < min) {
				min = d % 10;
			}
			d = d / 10 * 10 + 10;
		} d % 10 != 0 d % 10 d 10 0 {
			if (d % 10 < min) {
				min = d % 10;
			}
			d = d / 10 * 10 + 10;
		} if (d % 10 < min) {
				min = d % 10;
			} d % 10 < min d % 10 d 10 min {
				min = d % 10;
			} min = d % 10 min d % 10 d 10 d = d / 10 * 10 + 10 d d / 10 * 10 + 10 d / 10 * 10 d / 10 d 10 10 10 if (e % 10 != 0) {
			if (e % 10 < min) {
				min = e % 10;
			}
			e = e / 10 * 10 + 10;
		} e % 10 != 0 e % 10 e 10 0 {
			if (e % 10 < min) {
				min = e % 10;
			}
			e = e / 10 * 10 + 10;
		} if (e % 10 < min) {
				min = e % 10;
			} e % 10 < min e % 10 e 10 min {
				min = e % 10;
			} min = e % 10 min e % 10 e 10 e = e / 10 * 10 + 10 e e / 10 * 10 + 10 e / 10 * 10 e / 10 e 10 10 10 int ans = a + b + c + d + e - 10 + min; ans a + b + c + d + e - 10 + min a + b + c + d + e - 10 a + b + c + d + e d c a + b + c + d + e a b c d e 10 min System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int e = Integer.parseInt(sc.next());
		int min = 10;
		if (a % 10 != 0) {
			if (a % 10 < min) {
				min = a % 10;
			}
			a = a / 10 * 10 + 10;
		}
		if (b % 10 != 0) {
			if (b % 10 < min) {
				min = b % 10;
			}
			b = b / 10 * 10 + 10;
		}
		if (c % 10 != 0) {
			if (c % 10 < min) {
				min = c % 10;
			}
			c = c / 10 * 10 + 10;
		}
		if (d % 10 != 0) {
			if (d % 10 < min) {
				min = d % 10;
			}
			d = d / 10 * 10 + 10;
		}
		if (e % 10 != 0) {
			if (e % 10 < min) {
				min = e % 10;
			}
			e = e / 10 * 10 + 10;
		}
		int ans = a + b + c + d + e - 10 + min;
		System.out.println(ans);
		sc.close();
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int e = Integer.parseInt(sc.next());
		int min = 10;
		if (a % 10 != 0) {
			if (a % 10 < min) {
				min = a % 10;
			}
			a = a / 10 * 10 + 10;
		}
		if (b % 10 != 0) {
			if (b % 10 < min) {
				min = b % 10;
			}
			b = b / 10 * 10 + 10;
		}
		if (c % 10 != 0) {
			if (c % 10 < min) {
				min = c % 10;
			}
			c = c / 10 * 10 + 10;
		}
		if (d % 10 != 0) {
			if (d % 10 < min) {
				min = d % 10;
			}
			d = d / 10 * 10 + 10;
		}
		if (e % 10 != 0) {
			if (e % 10 < min) {
				min = e % 10;
			}
			e = e / 10 * 10 + 10;
		}
		int ans = a + b + c + d + e - 10 + min;
		System.out.println(ans);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int e = Integer.parseInt(sc.next());
		int min = 10;
		if (a % 10 != 0) {
			if (a % 10 < min) {
				min = a % 10;
			}
			a = a / 10 * 10 + 10;
		}
		if (b % 10 != 0) {
			if (b % 10 < min) {
				min = b % 10;
			}
			b = b / 10 * 10 + 10;
		}
		if (c % 10 != 0) {
			if (c % 10 < min) {
				min = c % 10;
			}
			c = c / 10 * 10 + 10;
		}
		if (d % 10 != 0) {
			if (d % 10 < min) {
				min = d % 10;
			}
			d = d / 10 * 10 + 10;
		}
		if (e % 10 != 0) {
			if (e % 10 < min) {
				min = e % 10;
			}
			e = e / 10 * 10 + 10;
		}
		int ans = a + b + c + d + e - 10 + min;
		System.out.println(ans);
		sc.close();
	}
}