import java.util.*;

class Main {
	static int sum;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] X = new int[5];
		for (int i=0;i<5;i++) {
			X[i]=sc.nextInt();
		}

		int sum=0;
		for (int i=0;i<5;i++) {
			int x;
			if (X[i]%10==0) {
				x=X[i];
			} else {
				x=X[i]/10*10+10;
			}
			sum+=x;
		}

		for (int i=0;i<5;i++) {
			X[i]=X[i]%10;
		}
		Arrays.sort(X);
		int min=0;
		for (int i=0;i<5;i++) {
			if (X[i]!=0) {
				min=X[i];
				break;
			}
		}
		if (X[0]==0 && X[1]==0 && X[2]==0 && X[3]==0 && X[4]==0) {
			System.out.println(sum);
		} else {
			System.out.println(sum-10+min);
		}
	}

} import java.util.*; util.* java class Main {
	static int sum;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] X = new int[5];
		for (int i=0;i<5;i++) {
			X[i]=sc.nextInt();
		}

		int sum=0;
		for (int i=0;i<5;i++) {
			int x;
			if (X[i]%10==0) {
				x=X[i];
			} else {
				x=X[i]/10*10+10;
			}
			sum+=x;
		}

		for (int i=0;i<5;i++) {
			X[i]=X[i]%10;
		}
		Arrays.sort(X);
		int min=0;
		for (int i=0;i<5;i++) {
			if (X[i]!=0) {
				min=X[i];
				break;
			}
		}
		if (X[0]==0 && X[1]==0 && X[2]==0 && X[3]==0 && X[4]==0) {
			System.out.println(sum);
		} else {
			System.out.println(sum-10+min);
		}
	}

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

		int sum=0;
		for (int i=0;i<5;i++) {
			int x;
			if (X[i]%10==0) {
				x=X[i];
			} else {
				x=X[i]/10*10+10;
			}
			sum+=x;
		}

		for (int i=0;i<5;i++) {
			X[i]=X[i]%10;
		}
		Arrays.sort(X);
		int min=0;
		for (int i=0;i<5;i++) {
			if (X[i]!=0) {
				min=X[i];
				break;
			}
		}
		if (X[0]==0 && X[1]==0 && X[2]==0 && X[3]==0 && X[4]==0) {
			System.out.println(sum);
		} else {
			System.out.println(sum-10+min);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int[] X = new int[5];
		for (int i=0;i<5;i++) {
			X[i]=sc.nextInt();
		}

		int sum=0;
		for (int i=0;i<5;i++) {
			int x;
			if (X[i]%10==0) {
				x=X[i];
			} else {
				x=X[i]/10*10+10;
			}
			sum+=x;
		}

		for (int i=0;i<5;i++) {
			X[i]=X[i]%10;
		}
		Arrays.sort(X);
		int min=0;
		for (int i=0;i<5;i++) {
			if (X[i]!=0) {
				min=X[i];
				break;
			}
		}
		if (X[0]==0 && X[1]==0 && X[2]==0 && X[3]==0 && X[4]==0) {
			System.out.println(sum);
		} else {
			System.out.println(sum-10+min);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] X = new int[5]; X new int[5] 5 for (int i=0;i<5;i++) {
			X[i]=sc.nextInt();
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			X[i]=sc.nextInt();
		} {
			X[i]=sc.nextInt();
		} X[i]=sc.nextInt() X[i] X i sc.nextInt() sc.nextInt sc int sum=0; sum 0 for (int i=0;i<5;i++) {
			int x;
			if (X[i]%10==0) {
				x=X[i];
			} else {
				x=X[i]/10*10+10;
			}
			sum+=x;
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			int x;
			if (X[i]%10==0) {
				x=X[i];
			} else {
				x=X[i]/10*10+10;
			}
			sum+=x;
		} {
			int x;
			if (X[i]%10==0) {
				x=X[i];
			} else {
				x=X[i]/10*10+10;
			}
			sum+=x;
		} int x; x if (X[i]%10==0) {
				x=X[i];
			} else {
				x=X[i]/10*10+10;
			} X[i]%10==0 X[i]%10 X[i] X i 10 0 {
				x=X[i];
			} x=X[i] x X[i] X i {
				x=X[i]/10*10+10;
			} x=X[i]/10*10+10 x X[i]/10*10+10 X[i]/10*10 X[i]/10 X[i] X i 10 10 10 sum+=x sum x for (int i=0;i<5;i++) {
			X[i]=X[i]%10;
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			X[i]=X[i]%10;
		} {
			X[i]=X[i]%10;
		} X[i]=X[i]%10 X[i] X i X[i]%10 X[i] X i 10 Arrays.sort(X) Arrays.sort Arrays X int min=0; min 0 for (int i=0;i<5;i++) {
			if (X[i]!=0) {
				min=X[i];
				break;
			}
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			if (X[i]!=0) {
				min=X[i];
				break;
			}
		} {
			if (X[i]!=0) {
				min=X[i];
				break;
			}
		} if (X[i]!=0) {
				min=X[i];
				break;
			} X[i]!=0 X[i] X i 0 {
				min=X[i];
				break;
			} min=X[i] min X[i] X i break; if (X[0]==0 && X[1]==0 && X[2]==0 && X[3]==0 && X[4]==0) {
			System.out.println(sum);
		} else {
			System.out.println(sum-10+min);
		} X[0]==0 && X[1]==0 && X[2]==0 && X[3]==0 && X[4]==0 X[3]==0 X[2]==0 X[0]==0 && X[1]==0 && X[2]==0 && X[3]==0 && X[4]==0 X[0]==0 X[0] X 0 0 X[1]==0 X[1] X 1 0 X[2]==0 X[2] X 2 0 X[3]==0 X[3] X 3 0 X[4]==0 X[4] X 4 0 {
			System.out.println(sum);
		} System.out.println(sum) System.out.println System.out System System.out sum {
			System.out.println(sum-10+min);
		} System.out.println(sum-10+min) System.out.println System.out System System.out sum-10+min sum-10 sum 10 min String[] args args
import java.util.*;

class Main {
	static int sum;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] X = new int[5];
		for (int i=0;i<5;i++) {
			X[i]=sc.nextInt();
		}

		int sum=0;
		for (int i=0;i<5;i++) {
			int x;
			if (X[i]%10==0) {
				x=X[i];
			} else {
				x=X[i]/10*10+10;
			}
			sum+=x;
		}

		for (int i=0;i<5;i++) {
			X[i]=X[i]%10;
		}
		Arrays.sort(X);
		int min=0;
		for (int i=0;i<5;i++) {
			if (X[i]!=0) {
				min=X[i];
				break;
			}
		}
		if (X[0]==0 && X[1]==0 && X[2]==0 && X[3]==0 && X[4]==0) {
			System.out.println(sum);
		} else {
			System.out.println(sum-10+min);
		}
	}

}