import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int min = 10;
		int sum = 0;
		for (int i=0;i<5;i++) {
			a[i] = sc.nextInt();
			if (a[i]%10!=0) {
				sum +=(a[i]/10+1)*10;
			} else {
				sum +=a[i];
			}
			if (a[i]%10!=0&&a[i]%10<min) {
				min = a[i]%10;
			}
		}
		if (min <10) {
			sum-=10-min;
		}
		System.out.println(sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int min = 10;
		int sum = 0;
		for (int i=0;i<5;i++) {
			a[i] = sc.nextInt();
			if (a[i]%10!=0) {
				sum +=(a[i]/10+1)*10;
			} else {
				sum +=a[i];
			}
			if (a[i]%10!=0&&a[i]%10<min) {
				min = a[i]%10;
			}
		}
		if (min <10) {
			sum-=10-min;
		}
		System.out.println(sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int min = 10;
		int sum = 0;
		for (int i=0;i<5;i++) {
			a[i] = sc.nextInt();
			if (a[i]%10!=0) {
				sum +=(a[i]/10+1)*10;
			} else {
				sum +=a[i];
			}
			if (a[i]%10!=0&&a[i]%10<min) {
				min = a[i]%10;
			}
		}
		if (min <10) {
			sum-=10-min;
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int min = 10;
		int sum = 0;
		for (int i=0;i<5;i++) {
			a[i] = sc.nextInt();
			if (a[i]%10!=0) {
				sum +=(a[i]/10+1)*10;
			} else {
				sum +=a[i];
			}
			if (a[i]%10!=0&&a[i]%10<min) {
				min = a[i]%10;
			}
		}
		if (min <10) {
			sum-=10-min;
		}
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a[] = new int[5]; a new int[5] 5 int min = 10; min 10 int sum = 0; sum 0 for (int i=0;i<5;i++) {
			a[i] = sc.nextInt();
			if (a[i]%10!=0) {
				sum +=(a[i]/10+1)*10;
			} else {
				sum +=a[i];
			}
			if (a[i]%10!=0&&a[i]%10<min) {
				min = a[i]%10;
			}
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			a[i] = sc.nextInt();
			if (a[i]%10!=0) {
				sum +=(a[i]/10+1)*10;
			} else {
				sum +=a[i];
			}
			if (a[i]%10!=0&&a[i]%10<min) {
				min = a[i]%10;
			}
		} {
			a[i] = sc.nextInt();
			if (a[i]%10!=0) {
				sum +=(a[i]/10+1)*10;
			} else {
				sum +=a[i];
			}
			if (a[i]%10!=0&&a[i]%10<min) {
				min = a[i]%10;
			}
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if (a[i]%10!=0) {
				sum +=(a[i]/10+1)*10;
			} else {
				sum +=a[i];
			} a[i]%10!=0 a[i]%10 a[i] a i 10 0 {
				sum +=(a[i]/10+1)*10;
			} sum +=(a[i]/10+1)*10 sum (a[i]/10+1)*10 (a[i]/10+1) a[i]/10 a[i] a i 10 1 10 {
				sum +=a[i];
			} sum +=a[i] sum a[i] a i if (a[i]%10!=0&&a[i]%10<min) {
				min = a[i]%10;
			} a[i]%10!=0&&a[i]%10<min a[i]%10!=0 a[i]%10 a[i] a i 10 0 a[i]%10<min a[i]%10 a[i] a i 10 min {
				min = a[i]%10;
			} min = a[i]%10 min a[i]%10 a[i] a i 10 if (min <10) {
			sum-=10-min;
		} min <10 min 10 {
			sum-=10-min;
		} sum-=10-min sum 10-min 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) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int min = 10;
		int sum = 0;
		for (int i=0;i<5;i++) {
			a[i] = sc.nextInt();
			if (a[i]%10!=0) {
				sum +=(a[i]/10+1)*10;
			} else {
				sum +=a[i];
			}
			if (a[i]%10!=0&&a[i]%10<min) {
				min = a[i]%10;
			}
		}
		if (min <10) {
			sum-=10-min;
		}
		System.out.println(sum);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int min = 10;
		int sum = 0;
		for (int i=0;i<5;i++) {
			a[i] = sc.nextInt();
			if (a[i]%10!=0) {
				sum +=(a[i]/10+1)*10;
			} else {
				sum +=a[i];
			}
			if (a[i]%10!=0&&a[i]%10<min) {
				min = a[i]%10;
			}
		}
		if (min <10) {
			sum-=10-min;
		}
		System.out.println(sum);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int min = 10;
		int sum = 0;
		for (int i=0;i<5;i++) {
			a[i] = sc.nextInt();
			if (a[i]%10!=0) {
				sum +=(a[i]/10+1)*10;
			} else {
				sum +=a[i];
			}
			if (a[i]%10!=0&&a[i]%10<min) {
				min = a[i]%10;
			}
		}
		if (min <10) {
			sum-=10-min;
		}
		System.out.println(sum);
	}
}