import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] data = new int[5];
		int max = 0;
		int sum = 0;

		for (int i = 0;i<5 ;i++ ) {
			data[i] = sc.nextInt();
			if (data[i]%10>0) {
				max = Math.max(max,10-data[i]%10);
			}
		}
		for (int i = 0;i<5 ;i++ ) {
			if (10-data[i]%10==max) {
				sum+=data[i];
				data[i] = 0;
				break;
			}
		}

		for (int i = 0;i<5 ;i++ ) {
		 if (data[i]%10==0) {
				sum+=data[i];
			}else{
				sum +=data[i]+10-data[i]%10;
			}
		}

		System.out.println(sum);


	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] data = new int[5];
		int max = 0;
		int sum = 0;

		for (int i = 0;i<5 ;i++ ) {
			data[i] = sc.nextInt();
			if (data[i]%10>0) {
				max = Math.max(max,10-data[i]%10);
			}
		}
		for (int i = 0;i<5 ;i++ ) {
			if (10-data[i]%10==max) {
				sum+=data[i];
				data[i] = 0;
				break;
			}
		}

		for (int i = 0;i<5 ;i++ ) {
		 if (data[i]%10==0) {
				sum+=data[i];
			}else{
				sum +=data[i]+10-data[i]%10;
			}
		}

		System.out.println(sum);


	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] data = new int[5];
		int max = 0;
		int sum = 0;

		for (int i = 0;i<5 ;i++ ) {
			data[i] = sc.nextInt();
			if (data[i]%10>0) {
				max = Math.max(max,10-data[i]%10);
			}
		}
		for (int i = 0;i<5 ;i++ ) {
			if (10-data[i]%10==max) {
				sum+=data[i];
				data[i] = 0;
				break;
			}
		}

		for (int i = 0;i<5 ;i++ ) {
		 if (data[i]%10==0) {
				sum+=data[i];
			}else{
				sum +=data[i]+10-data[i]%10;
			}
		}

		System.out.println(sum);


	} main {
		Scanner sc = new Scanner(System.in);

		int[] data = new int[5];
		int max = 0;
		int sum = 0;

		for (int i = 0;i<5 ;i++ ) {
			data[i] = sc.nextInt();
			if (data[i]%10>0) {
				max = Math.max(max,10-data[i]%10);
			}
		}
		for (int i = 0;i<5 ;i++ ) {
			if (10-data[i]%10==max) {
				sum+=data[i];
				data[i] = 0;
				break;
			}
		}

		for (int i = 0;i<5 ;i++ ) {
		 if (data[i]%10==0) {
				sum+=data[i];
			}else{
				sum +=data[i]+10-data[i]%10;
			}
		}

		System.out.println(sum);


	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] data = new int[5]; data new int[5] 5 int max = 0; max 0 int sum = 0; sum 0 for (int i = 0;i<5 ;i++ ) {
			data[i] = sc.nextInt();
			if (data[i]%10>0) {
				max = Math.max(max,10-data[i]%10);
			}
		} int i = 0; int i = 0; i 0 i<5 i 5 i++ i++ i {
			data[i] = sc.nextInt();
			if (data[i]%10>0) {
				max = Math.max(max,10-data[i]%10);
			}
		} {
			data[i] = sc.nextInt();
			if (data[i]%10>0) {
				max = Math.max(max,10-data[i]%10);
			}
		} data[i] = sc.nextInt() data[i] data i sc.nextInt() sc.nextInt sc if (data[i]%10>0) {
				max = Math.max(max,10-data[i]%10);
			} data[i]%10>0 data[i]%10 data[i] data i 10 0 {
				max = Math.max(max,10-data[i]%10);
			} max = Math.max(max,10-data[i]%10) max Math.max(max,10-data[i]%10) Math.max Math max 10-data[i]%10 10 data[i]%10 data[i] data i 10 for (int i = 0;i<5 ;i++ ) {
			if (10-data[i]%10==max) {
				sum+=data[i];
				data[i] = 0;
				break;
			}
		} int i = 0; int i = 0; i 0 i<5 i 5 i++ i++ i {
			if (10-data[i]%10==max) {
				sum+=data[i];
				data[i] = 0;
				break;
			}
		} {
			if (10-data[i]%10==max) {
				sum+=data[i];
				data[i] = 0;
				break;
			}
		} if (10-data[i]%10==max) {
				sum+=data[i];
				data[i] = 0;
				break;
			} 10-data[i]%10==max 10-data[i]%10 10 data[i]%10 data[i] data i 10 max {
				sum+=data[i];
				data[i] = 0;
				break;
			} sum+=data[i] sum data[i] data i data[i] = 0 data[i] data i 0 break; for (int i = 0;i<5 ;i++ ) {
		 if (data[i]%10==0) {
				sum+=data[i];
			}else{
				sum +=data[i]+10-data[i]%10;
			}
		} int i = 0; int i = 0; i 0 i<5 i 5 i++ i++ i {
		 if (data[i]%10==0) {
				sum+=data[i];
			}else{
				sum +=data[i]+10-data[i]%10;
			}
		} {
		 if (data[i]%10==0) {
				sum+=data[i];
			}else{
				sum +=data[i]+10-data[i]%10;
			}
		} if (data[i]%10==0) {
				sum+=data[i];
			}else{
				sum +=data[i]+10-data[i]%10;
			} data[i]%10==0 data[i]%10 data[i] data i 10 0 {
				sum+=data[i];
			} sum+=data[i] sum data[i] data i {
				sum +=data[i]+10-data[i]%10;
			} sum +=data[i]+10-data[i]%10 sum data[i]+10-data[i]%10 data[i]+10 data[i] data i 10 data[i]%10 data[i] data i 10 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) {
		Scanner sc = new Scanner(System.in);

		int[] data = new int[5];
		int max = 0;
		int sum = 0;

		for (int i = 0;i<5 ;i++ ) {
			data[i] = sc.nextInt();
			if (data[i]%10>0) {
				max = Math.max(max,10-data[i]%10);
			}
		}
		for (int i = 0;i<5 ;i++ ) {
			if (10-data[i]%10==max) {
				sum+=data[i];
				data[i] = 0;
				break;
			}
		}

		for (int i = 0;i<5 ;i++ ) {
		 if (data[i]%10==0) {
				sum+=data[i];
			}else{
				sum +=data[i]+10-data[i]%10;
			}
		}

		System.out.println(sum);


	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] data = new int[5];
		int max = 0;
		int sum = 0;

		for (int i = 0;i<5 ;i++ ) {
			data[i] = sc.nextInt();
			if (data[i]%10>0) {
				max = Math.max(max,10-data[i]%10);
			}
		}
		for (int i = 0;i<5 ;i++ ) {
			if (10-data[i]%10==max) {
				sum+=data[i];
				data[i] = 0;
				break;
			}
		}

		for (int i = 0;i<5 ;i++ ) {
		 if (data[i]%10==0) {
				sum+=data[i];
			}else{
				sum +=data[i]+10-data[i]%10;
			}
		}

		System.out.println(sum);


	}
} Main
import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] data = new int[5];
		int max = 0;
		int sum = 0;

		for (int i = 0;i<5 ;i++ ) {
			data[i] = sc.nextInt();
			if (data[i]%10>0) {
				max = Math.max(max,10-data[i]%10);
			}
		}
		for (int i = 0;i<5 ;i++ ) {
			if (10-data[i]%10==max) {
				sum+=data[i];
				data[i] = 0;
				break;
			}
		}

		for (int i = 0;i<5 ;i++ ) {
		 if (data[i]%10==0) {
				sum+=data[i];
			}else{
				sum +=data[i]+10-data[i]%10;
			}
		}

		System.out.println(sum);


	}
}
