
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int roughTotal = 0;
		int maxBlank = 0;
		for(int i = 0; i < 5; i++){
			a[i] = sc.nextInt();

			roughTotal += (a[i] + 9)/10*10;
			if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			}
		}

		System.out.println(roughTotal - maxBlank);
	}

} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int roughTotal = 0;
		int maxBlank = 0;
		for(int i = 0; i < 5; i++){
			a[i] = sc.nextInt();

			roughTotal += (a[i] + 9)/10*10;
			if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			}
		}

		System.out.println(roughTotal - maxBlank);
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int roughTotal = 0;
		int maxBlank = 0;
		for(int i = 0; i < 5; i++){
			a[i] = sc.nextInt();

			roughTotal += (a[i] + 9)/10*10;
			if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			}
		}

		System.out.println(roughTotal - maxBlank);
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int roughTotal = 0;
		int maxBlank = 0;
		for(int i = 0; i < 5; i++){
			a[i] = sc.nextInt();

			roughTotal += (a[i] + 9)/10*10;
			if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			}
		}

		System.out.println(roughTotal - maxBlank);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a[] = new int[5]; a new int[5] 5 int roughTotal = 0; roughTotal 0 int maxBlank = 0; maxBlank 0 for(int i = 0; i < 5; i++){
			a[i] = sc.nextInt();

			roughTotal += (a[i] + 9)/10*10;
			if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			a[i] = sc.nextInt();

			roughTotal += (a[i] + 9)/10*10;
			if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			}
		} {
			a[i] = sc.nextInt();

			roughTotal += (a[i] + 9)/10*10;
			if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			}
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc roughTotal += (a[i] + 9)/10*10 roughTotal (a[i] + 9)/10*10 (a[i] + 9)/10 (a[i] + 9) a[i] a i 9 10 10 if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			} a[i]%10 != 0 a[i]%10 a[i] a i 10 0 {
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			} maxBlank = Math.max(maxBlank, 10 - a[i]%10) maxBlank Math.max(maxBlank, 10 - a[i]%10) Math.max Math maxBlank 10 - a[i]%10 10 a[i]%10 a[i] a i 10 System.out.println(roughTotal - maxBlank) System.out.println System.out System System.out roughTotal - maxBlank roughTotal maxBlank String[] args args public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int roughTotal = 0;
		int maxBlank = 0;
		for(int i = 0; i < 5; i++){
			a[i] = sc.nextInt();

			roughTotal += (a[i] + 9)/10*10;
			if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			}
		}

		System.out.println(roughTotal - maxBlank);
	}

} public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int roughTotal = 0;
		int maxBlank = 0;
		for(int i = 0; i < 5; i++){
			a[i] = sc.nextInt();

			roughTotal += (a[i] + 9)/10*10;
			if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			}
		}

		System.out.println(roughTotal - maxBlank);
	}

} Main

import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int roughTotal = 0;
		int maxBlank = 0;
		for(int i = 0; i < 5; i++){
			a[i] = sc.nextInt();

			roughTotal += (a[i] + 9)/10*10;
			if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			}
		}

		System.out.println(roughTotal - maxBlank);
	}

}
