import java.util.Scanner;

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

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