import java.util.*;

public class Main {
	public static void main(String[] args) {
		int[] a = new int[5];
		int i;
		Scanner sc = new Scanner(System.in);
		for(i=0; i<5; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();
		sc = null;
		int sum = 0;
		int min = 9;
		int tmp;
		boolean f=false;
		for(i=0; i<5; i++) {
			tmp = a[i] % 10;
			sum += (a[i] / 10) * 10;
			if(tmp > 0) {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			}
		}
		if(f)System.out.println(sum - 10 + min);
		else System.out.println(sum);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		int[] a = new int[5];
		int i;
		Scanner sc = new Scanner(System.in);
		for(i=0; i<5; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();
		sc = null;
		int sum = 0;
		int min = 9;
		int tmp;
		boolean f=false;
		for(i=0; i<5; i++) {
			tmp = a[i] % 10;
			sum += (a[i] / 10) * 10;
			if(tmp > 0) {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			}
		}
		if(f)System.out.println(sum - 10 + min);
		else System.out.println(sum);
	}
} Main public static void main(String[] args) {
		int[] a = new int[5];
		int i;
		Scanner sc = new Scanner(System.in);
		for(i=0; i<5; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();
		sc = null;
		int sum = 0;
		int min = 9;
		int tmp;
		boolean f=false;
		for(i=0; i<5; i++) {
			tmp = a[i] % 10;
			sum += (a[i] / 10) * 10;
			if(tmp > 0) {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			}
		}
		if(f)System.out.println(sum - 10 + min);
		else System.out.println(sum);
	} main {
		int[] a = new int[5];
		int i;
		Scanner sc = new Scanner(System.in);
		for(i=0; i<5; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();
		sc = null;
		int sum = 0;
		int min = 9;
		int tmp;
		boolean f=false;
		for(i=0; i<5; i++) {
			tmp = a[i] % 10;
			sum += (a[i] / 10) * 10;
			if(tmp > 0) {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			}
		}
		if(f)System.out.println(sum - 10 + min);
		else System.out.println(sum);
	} int[] a = new int[5]; a new int[5] 5 int i; i Scanner sc = new Scanner(System.in); sc new Scanner(System.in) for(i=0; i<5; i++) {
			a[i] = sc.nextInt();
		} i=0; 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 sc.close() sc.close sc sc = null sc null int sum = 0; sum 0 int min = 9; min 9 int tmp; tmp boolean f=false; f false for(i=0; i<5; i++) {
			tmp = a[i] % 10;
			sum += (a[i] / 10) * 10;
			if(tmp > 0) {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			}
		} i=0; i=0 i 0 i<5 i 5 i++ i++ i {
			tmp = a[i] % 10;
			sum += (a[i] / 10) * 10;
			if(tmp > 0) {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			}
		} {
			tmp = a[i] % 10;
			sum += (a[i] / 10) * 10;
			if(tmp > 0) {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			}
		} tmp = a[i] % 10 tmp a[i] % 10 a[i] a i 10 sum += (a[i] / 10) * 10 sum (a[i] / 10) * 10 (a[i] / 10) a[i] a i 10 10 if(tmp > 0) {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			} tmp > 0 tmp 0 {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			} f=true f true sum += 10 sum 10 if(tmp < min) min = tmp; tmp < min tmp min min = tmp min tmp if(f)System.out.println(sum - 10 + min);
		else System.out.println(sum); f System.out.println(sum - 10 + min) System.out.println System.out System System.out sum - 10 + min sum - 10 sum 10 min System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
	public static void main(String[] args) {
		int[] a = new int[5];
		int i;
		Scanner sc = new Scanner(System.in);
		for(i=0; i<5; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();
		sc = null;
		int sum = 0;
		int min = 9;
		int tmp;
		boolean f=false;
		for(i=0; i<5; i++) {
			tmp = a[i] % 10;
			sum += (a[i] / 10) * 10;
			if(tmp > 0) {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			}
		}
		if(f)System.out.println(sum - 10 + min);
		else System.out.println(sum);
	}
} public class Main {
	public static void main(String[] args) {
		int[] a = new int[5];
		int i;
		Scanner sc = new Scanner(System.in);
		for(i=0; i<5; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();
		sc = null;
		int sum = 0;
		int min = 9;
		int tmp;
		boolean f=false;
		for(i=0; i<5; i++) {
			tmp = a[i] % 10;
			sum += (a[i] / 10) * 10;
			if(tmp > 0) {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			}
		}
		if(f)System.out.println(sum - 10 + min);
		else System.out.println(sum);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		int[] a = new int[5];
		int i;
		Scanner sc = new Scanner(System.in);
		for(i=0; i<5; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();
		sc = null;
		int sum = 0;
		int min = 9;
		int tmp;
		boolean f=false;
		for(i=0; i<5; i++) {
			tmp = a[i] % 10;
			sum += (a[i] / 10) * 10;
			if(tmp > 0) {
				f=true;
				sum += 10;
				if(tmp < min) min = tmp;
			}
		}
		if(f)System.out.println(sum - 10 + min);
		else System.out.println(sum);
	}
}