import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		
		int aa = a % 10;
		int bb = b % 10;
		int cc = c % 10;
		int dd = d % 10;
		int ee = e % 10;
      
      if(aa == 0){
        aa += 10;
      } if(bb == 0){
        bb += 10;
      }if(cc == 0){
        cc += 10;
      } if(dd == 0){
        dd += 10;
      } if(ee == 0){
        ee += 10;
      }
		int min = 10;
		if(min > aa){
		    min = aa;
		}if(min > bb){
		    min = bb;
		}if(min > cc){
		    min = cc;
		}if(min > dd){
		    min = dd;
		}if(min > ee){
		    min = ee;
		}
      int aaa = 0;
      int bbb = 0;
      int ccc = 0;
      int ddd = 0;
      int eee = 0;
      
      	if(a%10 != 0){
		 aaa =(int)Math.ceil(a / 10.0)*10;
        }else{
         aaa = a;
        }
      if(b%10 != 0){
		bbb = (int)Math.ceil(b / 10.0)*10;
        }else{
         bbb = b;
        }
      if(c%10 != 0){
		 ccc = (int)Math.ceil(c / 10.0)*10;
        }else{
         ccc = c;
        }
      if(d%10 != 0){
		 ddd = (int)Math.ceil(d / 10.0)*10;
        }else{
         ddd = d;
        }
      if(e%10 != 0){
		 eee = (int)Math.ceil(e / 10.0)*10;
        }else{
         eee = e;
        }
		int ans = aaa + bbb + ccc + ddd + eee - 10 + min;
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		
		int aa = a % 10;
		int bb = b % 10;
		int cc = c % 10;
		int dd = d % 10;
		int ee = e % 10;
      
      if(aa == 0){
        aa += 10;
      } if(bb == 0){
        bb += 10;
      }if(cc == 0){
        cc += 10;
      } if(dd == 0){
        dd += 10;
      } if(ee == 0){
        ee += 10;
      }
		int min = 10;
		if(min > aa){
		    min = aa;
		}if(min > bb){
		    min = bb;
		}if(min > cc){
		    min = cc;
		}if(min > dd){
		    min = dd;
		}if(min > ee){
		    min = ee;
		}
      int aaa = 0;
      int bbb = 0;
      int ccc = 0;
      int ddd = 0;
      int eee = 0;
      
      	if(a%10 != 0){
		 aaa =(int)Math.ceil(a / 10.0)*10;
        }else{
         aaa = a;
        }
      if(b%10 != 0){
		bbb = (int)Math.ceil(b / 10.0)*10;
        }else{
         bbb = b;
        }
      if(c%10 != 0){
		 ccc = (int)Math.ceil(c / 10.0)*10;
        }else{
         ccc = c;
        }
      if(d%10 != 0){
		 ddd = (int)Math.ceil(d / 10.0)*10;
        }else{
         ddd = d;
        }
      if(e%10 != 0){
		 eee = (int)Math.ceil(e / 10.0)*10;
        }else{
         eee = e;
        }
		int ans = aaa + bbb + ccc + ddd + eee - 10 + min;
		System.out.println(ans);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		
		int aa = a % 10;
		int bb = b % 10;
		int cc = c % 10;
		int dd = d % 10;
		int ee = e % 10;
      
      if(aa == 0){
        aa += 10;
      } if(bb == 0){
        bb += 10;
      }if(cc == 0){
        cc += 10;
      } if(dd == 0){
        dd += 10;
      } if(ee == 0){
        ee += 10;
      }
		int min = 10;
		if(min > aa){
		    min = aa;
		}if(min > bb){
		    min = bb;
		}if(min > cc){
		    min = cc;
		}if(min > dd){
		    min = dd;
		}if(min > ee){
		    min = ee;
		}
      int aaa = 0;
      int bbb = 0;
      int ccc = 0;
      int ddd = 0;
      int eee = 0;
      
      	if(a%10 != 0){
		 aaa =(int)Math.ceil(a / 10.0)*10;
        }else{
         aaa = a;
        }
      if(b%10 != 0){
		bbb = (int)Math.ceil(b / 10.0)*10;
        }else{
         bbb = b;
        }
      if(c%10 != 0){
		 ccc = (int)Math.ceil(c / 10.0)*10;
        }else{
         ccc = c;
        }
      if(d%10 != 0){
		 ddd = (int)Math.ceil(d / 10.0)*10;
        }else{
         ddd = d;
        }
      if(e%10 != 0){
		 eee = (int)Math.ceil(e / 10.0)*10;
        }else{
         eee = e;
        }
		int ans = aaa + bbb + ccc + ddd + eee - 10 + min;
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		
		int aa = a % 10;
		int bb = b % 10;
		int cc = c % 10;
		int dd = d % 10;
		int ee = e % 10;
      
      if(aa == 0){
        aa += 10;
      } if(bb == 0){
        bb += 10;
      }if(cc == 0){
        cc += 10;
      } if(dd == 0){
        dd += 10;
      } if(ee == 0){
        ee += 10;
      }
		int min = 10;
		if(min > aa){
		    min = aa;
		}if(min > bb){
		    min = bb;
		}if(min > cc){
		    min = cc;
		}if(min > dd){
		    min = dd;
		}if(min > ee){
		    min = ee;
		}
      int aaa = 0;
      int bbb = 0;
      int ccc = 0;
      int ddd = 0;
      int eee = 0;
      
      	if(a%10 != 0){
		 aaa =(int)Math.ceil(a / 10.0)*10;
        }else{
         aaa = a;
        }
      if(b%10 != 0){
		bbb = (int)Math.ceil(b / 10.0)*10;
        }else{
         bbb = b;
        }
      if(c%10 != 0){
		 ccc = (int)Math.ceil(c / 10.0)*10;
        }else{
         ccc = c;
        }
      if(d%10 != 0){
		 ddd = (int)Math.ceil(d / 10.0)*10;
        }else{
         ddd = d;
        }
      if(e%10 != 0){
		 eee = (int)Math.ceil(e / 10.0)*10;
        }else{
         eee = e;
        }
		int ans = aaa + bbb + ccc + ddd + eee - 10 + min;
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc int e = sc.nextInt(); e sc.nextInt() sc.nextInt sc int aa = a % 10; aa a % 10 a 10 int bb = b % 10; bb b % 10 b 10 int cc = c % 10; cc c % 10 c 10 int dd = d % 10; dd d % 10 d 10 int ee = e % 10; ee e % 10 e 10 if(aa == 0){
        aa += 10;
      } aa == 0 aa 0 {
        aa += 10;
      } aa += 10 aa 10 if(bb == 0){
        bb += 10;
      } bb == 0 bb 0 {
        bb += 10;
      } bb += 10 bb 10 if(cc == 0){
        cc += 10;
      } cc == 0 cc 0 {
        cc += 10;
      } cc += 10 cc 10 if(dd == 0){
        dd += 10;
      } dd == 0 dd 0 {
        dd += 10;
      } dd += 10 dd 10 if(ee == 0){
        ee += 10;
      } ee == 0 ee 0 {
        ee += 10;
      } ee += 10 ee 10 int min = 10; min 10 if(min > aa){
		    min = aa;
		} min > aa min aa {
		    min = aa;
		} min = aa min aa if(min > bb){
		    min = bb;
		} min > bb min bb {
		    min = bb;
		} min = bb min bb if(min > cc){
		    min = cc;
		} min > cc min cc {
		    min = cc;
		} min = cc min cc if(min > dd){
		    min = dd;
		} min > dd min dd {
		    min = dd;
		} min = dd min dd if(min > ee){
		    min = ee;
		} min > ee min ee {
		    min = ee;
		} min = ee min ee int aaa = 0; aaa 0 int bbb = 0; bbb 0 int ccc = 0; ccc 0 int ddd = 0; ddd 0 int eee = 0; eee 0 if(a%10 != 0){
		 aaa =(int)Math.ceil(a / 10.0)*10;
        }else{
         aaa = a;
        } a%10 != 0 a%10 a 10 0 {
		 aaa =(int)Math.ceil(a / 10.0)*10;
        } aaa =(int)Math.ceil(a / 10.0)*10 aaa (int)Math.ceil(a / 10.0)*10 (int)Math.ceil(a / 10.0) Math.ceil Math a / 10.0 a 10.0 10 {
         aaa = a;
        } aaa = a aaa a if(b%10 != 0){
		bbb = (int)Math.ceil(b / 10.0)*10;
        }else{
         bbb = b;
        } b%10 != 0 b%10 b 10 0 {
		bbb = (int)Math.ceil(b / 10.0)*10;
        } bbb = (int)Math.ceil(b / 10.0)*10 bbb (int)Math.ceil(b / 10.0)*10 (int)Math.ceil(b / 10.0) Math.ceil Math b / 10.0 b 10.0 10 {
         bbb = b;
        } bbb = b bbb b if(c%10 != 0){
		 ccc = (int)Math.ceil(c / 10.0)*10;
        }else{
         ccc = c;
        } c%10 != 0 c%10 c 10 0 {
		 ccc = (int)Math.ceil(c / 10.0)*10;
        } ccc = (int)Math.ceil(c / 10.0)*10 ccc (int)Math.ceil(c / 10.0)*10 (int)Math.ceil(c / 10.0) Math.ceil Math c / 10.0 c 10.0 10 {
         ccc = c;
        } ccc = c ccc c if(d%10 != 0){
		 ddd = (int)Math.ceil(d / 10.0)*10;
        }else{
         ddd = d;
        } d%10 != 0 d%10 d 10 0 {
		 ddd = (int)Math.ceil(d / 10.0)*10;
        } ddd = (int)Math.ceil(d / 10.0)*10 ddd (int)Math.ceil(d / 10.0)*10 (int)Math.ceil(d / 10.0) Math.ceil Math d / 10.0 d 10.0 10 {
         ddd = d;
        } ddd = d ddd d if(e%10 != 0){
		 eee = (int)Math.ceil(e / 10.0)*10;
        }else{
         eee = e;
        } e%10 != 0 e%10 e 10 0 {
		 eee = (int)Math.ceil(e / 10.0)*10;
        } eee = (int)Math.ceil(e / 10.0)*10 eee (int)Math.ceil(e / 10.0)*10 (int)Math.ceil(e / 10.0) Math.ceil Math e / 10.0 e 10.0 10 {
         eee = e;
        } eee = e eee e int ans = aaa + bbb + ccc + ddd + eee - 10 + min; ans aaa + bbb + ccc + ddd + eee - 10 + min aaa + bbb + ccc + ddd + eee - 10 aaa + bbb + ccc + ddd + eee ddd ccc aaa + bbb + ccc + ddd + eee aaa bbb ccc ddd eee 10 min System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		
		int aa = a % 10;
		int bb = b % 10;
		int cc = c % 10;
		int dd = d % 10;
		int ee = e % 10;
      
      if(aa == 0){
        aa += 10;
      } if(bb == 0){
        bb += 10;
      }if(cc == 0){
        cc += 10;
      } if(dd == 0){
        dd += 10;
      } if(ee == 0){
        ee += 10;
      }
		int min = 10;
		if(min > aa){
		    min = aa;
		}if(min > bb){
		    min = bb;
		}if(min > cc){
		    min = cc;
		}if(min > dd){
		    min = dd;
		}if(min > ee){
		    min = ee;
		}
      int aaa = 0;
      int bbb = 0;
      int ccc = 0;
      int ddd = 0;
      int eee = 0;
      
      	if(a%10 != 0){
		 aaa =(int)Math.ceil(a / 10.0)*10;
        }else{
         aaa = a;
        }
      if(b%10 != 0){
		bbb = (int)Math.ceil(b / 10.0)*10;
        }else{
         bbb = b;
        }
      if(c%10 != 0){
		 ccc = (int)Math.ceil(c / 10.0)*10;
        }else{
         ccc = c;
        }
      if(d%10 != 0){
		 ddd = (int)Math.ceil(d / 10.0)*10;
        }else{
         ddd = d;
        }
      if(e%10 != 0){
		 eee = (int)Math.ceil(e / 10.0)*10;
        }else{
         eee = e;
        }
		int ans = aaa + bbb + ccc + ddd + eee - 10 + min;
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		
		int aa = a % 10;
		int bb = b % 10;
		int cc = c % 10;
		int dd = d % 10;
		int ee = e % 10;
      
      if(aa == 0){
        aa += 10;
      } if(bb == 0){
        bb += 10;
      }if(cc == 0){
        cc += 10;
      } if(dd == 0){
        dd += 10;
      } if(ee == 0){
        ee += 10;
      }
		int min = 10;
		if(min > aa){
		    min = aa;
		}if(min > bb){
		    min = bb;
		}if(min > cc){
		    min = cc;
		}if(min > dd){
		    min = dd;
		}if(min > ee){
		    min = ee;
		}
      int aaa = 0;
      int bbb = 0;
      int ccc = 0;
      int ddd = 0;
      int eee = 0;
      
      	if(a%10 != 0){
		 aaa =(int)Math.ceil(a / 10.0)*10;
        }else{
         aaa = a;
        }
      if(b%10 != 0){
		bbb = (int)Math.ceil(b / 10.0)*10;
        }else{
         bbb = b;
        }
      if(c%10 != 0){
		 ccc = (int)Math.ceil(c / 10.0)*10;
        }else{
         ccc = c;
        }
      if(d%10 != 0){
		 ddd = (int)Math.ceil(d / 10.0)*10;
        }else{
         ddd = d;
        }
      if(e%10 != 0){
		 eee = (int)Math.ceil(e / 10.0)*10;
        }else{
         eee = e;
        }
		int ans = aaa + bbb + ccc + ddd + eee - 10 + min;
		System.out.println(ans);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		
		int aa = a % 10;
		int bb = b % 10;
		int cc = c % 10;
		int dd = d % 10;
		int ee = e % 10;
      
      if(aa == 0){
        aa += 10;
      } if(bb == 0){
        bb += 10;
      }if(cc == 0){
        cc += 10;
      } if(dd == 0){
        dd += 10;
      } if(ee == 0){
        ee += 10;
      }
		int min = 10;
		if(min > aa){
		    min = aa;
		}if(min > bb){
		    min = bb;
		}if(min > cc){
		    min = cc;
		}if(min > dd){
		    min = dd;
		}if(min > ee){
		    min = ee;
		}
      int aaa = 0;
      int bbb = 0;
      int ccc = 0;
      int ddd = 0;
      int eee = 0;
      
      	if(a%10 != 0){
		 aaa =(int)Math.ceil(a / 10.0)*10;
        }else{
         aaa = a;
        }
      if(b%10 != 0){
		bbb = (int)Math.ceil(b / 10.0)*10;
        }else{
         bbb = b;
        }
      if(c%10 != 0){
		 ccc = (int)Math.ceil(c / 10.0)*10;
        }else{
         ccc = c;
        }
      if(d%10 != 0){
		 ddd = (int)Math.ceil(d / 10.0)*10;
        }else{
         ddd = d;
        }
      if(e%10 != 0){
		 eee = (int)Math.ceil(e / 10.0)*10;
        }else{
         eee = e;
        }
		int ans = aaa + bbb + ccc + ddd + eee - 10 + min;
		System.out.println(ans);
	}
}
