import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		try {
			
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			int A = Integer.parseInt(br.readLine());
			int B = Integer.parseInt(br.readLine());
			int C = Integer.parseInt(br.readLine());
			int D = Integer.parseInt(br.readLine());
			int E = Integer.parseInt(br.readLine());
			
			int[] full = {A,B,C,D,E};
			int[] keta1 = {A%10,B%10,C%10,D%10,E%10};
			int min = 9;
			int minIndex=0;
			for (int i=0;i<5;i++) {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			}
			int sum=0;
			for (int i=0;i<5;i++) {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			}

			
			
			System.out.println(	sum);
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	private static void init() {
		
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.lang.reflect.Array; Array java.lang.reflect import java.math.BigDecimal; BigDecimal java.math import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {

	public static void main(String[] args) {
		try {
			
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			int A = Integer.parseInt(br.readLine());
			int B = Integer.parseInt(br.readLine());
			int C = Integer.parseInt(br.readLine());
			int D = Integer.parseInt(br.readLine());
			int E = Integer.parseInt(br.readLine());
			
			int[] full = {A,B,C,D,E};
			int[] keta1 = {A%10,B%10,C%10,D%10,E%10};
			int min = 9;
			int minIndex=0;
			for (int i=0;i<5;i++) {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			}
			int sum=0;
			for (int i=0;i<5;i++) {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			}

			
			
			System.out.println(	sum);
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	private static void init() {
		
	}
} Main public static void main(String[] args) {
		try {
			
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			int A = Integer.parseInt(br.readLine());
			int B = Integer.parseInt(br.readLine());
			int C = Integer.parseInt(br.readLine());
			int D = Integer.parseInt(br.readLine());
			int E = Integer.parseInt(br.readLine());
			
			int[] full = {A,B,C,D,E};
			int[] keta1 = {A%10,B%10,C%10,D%10,E%10};
			int min = 9;
			int minIndex=0;
			for (int i=0;i<5;i++) {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			}
			int sum=0;
			for (int i=0;i<5;i++) {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			}

			
			
			System.out.println(	sum);
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	} main {
		try {
			
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			int A = Integer.parseInt(br.readLine());
			int B = Integer.parseInt(br.readLine());
			int C = Integer.parseInt(br.readLine());
			int D = Integer.parseInt(br.readLine());
			int E = Integer.parseInt(br.readLine());
			
			int[] full = {A,B,C,D,E};
			int[] keta1 = {A%10,B%10,C%10,D%10,E%10};
			int min = 9;
			int minIndex=0;
			for (int i=0;i<5;i++) {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			}
			int sum=0;
			for (int i=0;i<5;i++) {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			}

			
			
			System.out.println(	sum);
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	} try {
			
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			int A = Integer.parseInt(br.readLine());
			int B = Integer.parseInt(br.readLine());
			int C = Integer.parseInt(br.readLine());
			int D = Integer.parseInt(br.readLine());
			int E = Integer.parseInt(br.readLine());
			
			int[] full = {A,B,C,D,E};
			int[] keta1 = {A%10,B%10,C%10,D%10,E%10};
			int min = 9;
			int minIndex=0;
			for (int i=0;i<5;i++) {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			}
			int sum=0;
			for (int i=0;i<5;i++) {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			}

			
			
			System.out.println(	sum);
			
			
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			int A = Integer.parseInt(br.readLine());
			int B = Integer.parseInt(br.readLine());
			int C = Integer.parseInt(br.readLine());
			int D = Integer.parseInt(br.readLine());
			int E = Integer.parseInt(br.readLine());
			
			int[] full = {A,B,C,D,E};
			int[] keta1 = {A%10,B%10,C%10,D%10,E%10};
			int min = 9;
			int minIndex=0;
			for (int i=0;i<5;i++) {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			}
			int sum=0;
			for (int i=0;i<5;i++) {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			}

			
			
			System.out.println(	sum);
			
			
		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int A = Integer.parseInt(br.readLine()); A Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int B = Integer.parseInt(br.readLine()); B Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int C = Integer.parseInt(br.readLine()); C Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int D = Integer.parseInt(br.readLine()); D Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int E = Integer.parseInt(br.readLine()); E Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] full = {A,B,C,D,E}; full {A,B,C,D,E} A B C D E int[] keta1 = {A%10,B%10,C%10,D%10,E%10}; keta1 {A%10,B%10,C%10,D%10,E%10} A%10 A 10 B%10 B 10 C%10 C 10 D%10 D 10 E%10 E 10 int min = 9; min 9 int minIndex=0; minIndex 0 for (int i=0;i<5;i++) {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			} {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			} if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				} 0<keta1[i] && keta1[i] < min 0<keta1[i] 0 keta1[i] keta1 i keta1[i] < min keta1[i] keta1 i min {
					min=keta1[i];
					minIndex=i;
				} min=keta1[i] min keta1[i] keta1 i minIndex=i minIndex i int sum=0; sum 0 for (int i=0;i<5;i++) {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			} {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			} if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				} i!=minIndex i minIndex {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					} full[i]%10 == 0 full[i]%10 full[i] full i 10 0 {
						sum=sum+full[i];
					} sum=sum+full[i] sum sum+full[i] sum full[i] full i {
						sum=sum+(full[i]/10+1)*10;	
					} sum=sum+(full[i]/10+1)*10 sum sum+(full[i]/10+1)*10 sum (full[i]/10+1)*10 (full[i]/10+1) full[i]/10 full[i] full i 10 1 10 {
					sum=sum+full[i];
                  
				} sum=sum+full[i] sum sum+full[i] sum full[i] full i System.out.println(	sum) System.out.println System.out System System.out sum String[] args args private static void init() {
		
	} init {
		
	} public class Main {

	public static void main(String[] args) {
		try {
			
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			int A = Integer.parseInt(br.readLine());
			int B = Integer.parseInt(br.readLine());
			int C = Integer.parseInt(br.readLine());
			int D = Integer.parseInt(br.readLine());
			int E = Integer.parseInt(br.readLine());
			
			int[] full = {A,B,C,D,E};
			int[] keta1 = {A%10,B%10,C%10,D%10,E%10};
			int min = 9;
			int minIndex=0;
			for (int i=0;i<5;i++) {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			}
			int sum=0;
			for (int i=0;i<5;i++) {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			}

			
			
			System.out.println(	sum);
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	private static void init() {
		
	}
} public class Main {

	public static void main(String[] args) {
		try {
			
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			int A = Integer.parseInt(br.readLine());
			int B = Integer.parseInt(br.readLine());
			int C = Integer.parseInt(br.readLine());
			int D = Integer.parseInt(br.readLine());
			int E = Integer.parseInt(br.readLine());
			
			int[] full = {A,B,C,D,E};
			int[] keta1 = {A%10,B%10,C%10,D%10,E%10};
			int min = 9;
			int minIndex=0;
			for (int i=0;i<5;i++) {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			}
			int sum=0;
			for (int i=0;i<5;i++) {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			}

			
			
			System.out.println(	sum);
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	private static void init() {
		
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		try {
			
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			int A = Integer.parseInt(br.readLine());
			int B = Integer.parseInt(br.readLine());
			int C = Integer.parseInt(br.readLine());
			int D = Integer.parseInt(br.readLine());
			int E = Integer.parseInt(br.readLine());
			
			int[] full = {A,B,C,D,E};
			int[] keta1 = {A%10,B%10,C%10,D%10,E%10};
			int min = 9;
			int minIndex=0;
			for (int i=0;i<5;i++) {
				if (0<keta1[i] && keta1[i] < min) {
					min=keta1[i];
					minIndex=i;
				}
			}
			int sum=0;
			for (int i=0;i<5;i++) {
				if (i!=minIndex) {
					if (full[i]%10 == 0) {
						sum=sum+full[i];
					} else {
						sum=sum+(full[i]/10+1)*10;	
					}
				} else {
					sum=sum+full[i];
                  
				}
			}

			
			
			System.out.println(	sum);
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	private static void init() {
		
	}
}
