import java.util.*;

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

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		for(int i = 0; i < 5; i++){
			a[i] = sc.nextInt();
		}
		int min = 999;
		int soe = -1;
		for(int i = 0; i < 5; i++){
			if(a[i]%10 != 0){
				if(min > a[i]%10){
					soe = i;
					min = a[i]%10;
				}
			}
		}
		int ans = 0;
		for(int i = 0; i < 5; i++){
			if(soe == i){
				ans+=a[i];
			}else{
				ans+=(a[i]/10+(a[i]%10==0?0:1))*10;
			}
		}
		System.out.print(ans);
	}
}
