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();
    
    if(a<=123 && a>=1 && b<=123 && b>=1 && c<=123 && c>=1 
       && d<=123 && d>=1 && e<=123 && e>=1){
        int a1 = 0;
      int b1 = 0;
      int c1 = 0;
      int d1 = 0;
      int e1 = 0;
      if(a % 10 != 0){
       a1 = (int)Math.round((a+5)/10.0)*10;
      }else{
        a1 = a;
      }
      if(b % 10 != 0){
       b1 = (int)Math.round((b+5)/10.0)*10;
      }else{
        b1 = b;
      }
      if(c % 10 != 0){
       c1 = (int)Math.round((c+5)/10.0)*10;
      }else{
        c1 = c;
      }
      if(d % 10 != 0){
       d1 = (int)Math.round((d+5)/10.0)*10;
      }else{
        d1 = d;
      }
      if(e % 10 != 0){
       e1 = (int)Math.round((e+5)/10.0)*10;
      }else{
        e1 = e;
      }
      
      int ans = a1 + b1 + c1 + d1 + e1;
      
      int a2 = a1 - a;
      int b2 = b1 - b;
      int c2 = c1 - c;
      int d2 = d1 - d;
      int e2 = e1 - e;
      
      int[] list = {a2,b2,c2,d2,e2};
      
      int intMax = list[0];
      for(int i = 1; i < list.length; i++){
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      }
      int answer = ans - intMax;
      System.out.println(answer);
      
    }else{
       System.out.println("入力範囲に違反しています");
    }
  }
} 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();
    
    if(a<=123 && a>=1 && b<=123 && b>=1 && c<=123 && c>=1 
       && d<=123 && d>=1 && e<=123 && e>=1){
        int a1 = 0;
      int b1 = 0;
      int c1 = 0;
      int d1 = 0;
      int e1 = 0;
      if(a % 10 != 0){
       a1 = (int)Math.round((a+5)/10.0)*10;
      }else{
        a1 = a;
      }
      if(b % 10 != 0){
       b1 = (int)Math.round((b+5)/10.0)*10;
      }else{
        b1 = b;
      }
      if(c % 10 != 0){
       c1 = (int)Math.round((c+5)/10.0)*10;
      }else{
        c1 = c;
      }
      if(d % 10 != 0){
       d1 = (int)Math.round((d+5)/10.0)*10;
      }else{
        d1 = d;
      }
      if(e % 10 != 0){
       e1 = (int)Math.round((e+5)/10.0)*10;
      }else{
        e1 = e;
      }
      
      int ans = a1 + b1 + c1 + d1 + e1;
      
      int a2 = a1 - a;
      int b2 = b1 - b;
      int c2 = c1 - c;
      int d2 = d1 - d;
      int e2 = e1 - e;
      
      int[] list = {a2,b2,c2,d2,e2};
      
      int intMax = list[0];
      for(int i = 1; i < list.length; i++){
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      }
      int answer = ans - intMax;
      System.out.println(answer);
      
    }else{
       System.out.println("入力範囲に違反しています");
    }
  }
} 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();
    
    if(a<=123 && a>=1 && b<=123 && b>=1 && c<=123 && c>=1 
       && d<=123 && d>=1 && e<=123 && e>=1){
        int a1 = 0;
      int b1 = 0;
      int c1 = 0;
      int d1 = 0;
      int e1 = 0;
      if(a % 10 != 0){
       a1 = (int)Math.round((a+5)/10.0)*10;
      }else{
        a1 = a;
      }
      if(b % 10 != 0){
       b1 = (int)Math.round((b+5)/10.0)*10;
      }else{
        b1 = b;
      }
      if(c % 10 != 0){
       c1 = (int)Math.round((c+5)/10.0)*10;
      }else{
        c1 = c;
      }
      if(d % 10 != 0){
       d1 = (int)Math.round((d+5)/10.0)*10;
      }else{
        d1 = d;
      }
      if(e % 10 != 0){
       e1 = (int)Math.round((e+5)/10.0)*10;
      }else{
        e1 = e;
      }
      
      int ans = a1 + b1 + c1 + d1 + e1;
      
      int a2 = a1 - a;
      int b2 = b1 - b;
      int c2 = c1 - c;
      int d2 = d1 - d;
      int e2 = e1 - e;
      
      int[] list = {a2,b2,c2,d2,e2};
      
      int intMax = list[0];
      for(int i = 1; i < list.length; i++){
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      }
      int answer = ans - intMax;
      System.out.println(answer);
      
    }else{
       System.out.println("入力範囲に違反しています");
    }
  } 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();
    
    if(a<=123 && a>=1 && b<=123 && b>=1 && c<=123 && c>=1 
       && d<=123 && d>=1 && e<=123 && e>=1){
        int a1 = 0;
      int b1 = 0;
      int c1 = 0;
      int d1 = 0;
      int e1 = 0;
      if(a % 10 != 0){
       a1 = (int)Math.round((a+5)/10.0)*10;
      }else{
        a1 = a;
      }
      if(b % 10 != 0){
       b1 = (int)Math.round((b+5)/10.0)*10;
      }else{
        b1 = b;
      }
      if(c % 10 != 0){
       c1 = (int)Math.round((c+5)/10.0)*10;
      }else{
        c1 = c;
      }
      if(d % 10 != 0){
       d1 = (int)Math.round((d+5)/10.0)*10;
      }else{
        d1 = d;
      }
      if(e % 10 != 0){
       e1 = (int)Math.round((e+5)/10.0)*10;
      }else{
        e1 = e;
      }
      
      int ans = a1 + b1 + c1 + d1 + e1;
      
      int a2 = a1 - a;
      int b2 = b1 - b;
      int c2 = c1 - c;
      int d2 = d1 - d;
      int e2 = e1 - e;
      
      int[] list = {a2,b2,c2,d2,e2};
      
      int intMax = list[0];
      for(int i = 1; i < list.length; i++){
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      }
      int answer = ans - intMax;
      System.out.println(answer);
      
    }else{
       System.out.println("入力範囲に違反しています");
    }
  } 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 if(a<=123 && a>=1 && b<=123 && b>=1 && c<=123 && c>=1 
       && d<=123 && d>=1 && e<=123 && e>=1){
        int a1 = 0;
      int b1 = 0;
      int c1 = 0;
      int d1 = 0;
      int e1 = 0;
      if(a % 10 != 0){
       a1 = (int)Math.round((a+5)/10.0)*10;
      }else{
        a1 = a;
      }
      if(b % 10 != 0){
       b1 = (int)Math.round((b+5)/10.0)*10;
      }else{
        b1 = b;
      }
      if(c % 10 != 0){
       c1 = (int)Math.round((c+5)/10.0)*10;
      }else{
        c1 = c;
      }
      if(d % 10 != 0){
       d1 = (int)Math.round((d+5)/10.0)*10;
      }else{
        d1 = d;
      }
      if(e % 10 != 0){
       e1 = (int)Math.round((e+5)/10.0)*10;
      }else{
        e1 = e;
      }
      
      int ans = a1 + b1 + c1 + d1 + e1;
      
      int a2 = a1 - a;
      int b2 = b1 - b;
      int c2 = c1 - c;
      int d2 = d1 - d;
      int e2 = e1 - e;
      
      int[] list = {a2,b2,c2,d2,e2};
      
      int intMax = list[0];
      for(int i = 1; i < list.length; i++){
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      }
      int answer = ans - intMax;
      System.out.println(answer);
      
    }else{
       System.out.println("入力範囲に違反しています");
    } a<=123 && a>=1 && b<=123 && b>=1 && c<=123 && c>=1 
       && d<=123 && d>=1 && e<=123 && e>=1 e<=123 d>=1 d<=123 c>=1 c<=123 b>=1 b<=123 a<=123 && a>=1 && b<=123 && b>=1 && c<=123 && c>=1 
       && d<=123 && d>=1 && e<=123 && e>=1 a<=123 a 123 a>=1 a 1 b<=123 b 123 b>=1 b 1 c<=123 c 123 c>=1 c 1 d<=123 d 123 d>=1 d 1 e<=123 e 123 e>=1 e 1 {
        int a1 = 0;
      int b1 = 0;
      int c1 = 0;
      int d1 = 0;
      int e1 = 0;
      if(a % 10 != 0){
       a1 = (int)Math.round((a+5)/10.0)*10;
      }else{
        a1 = a;
      }
      if(b % 10 != 0){
       b1 = (int)Math.round((b+5)/10.0)*10;
      }else{
        b1 = b;
      }
      if(c % 10 != 0){
       c1 = (int)Math.round((c+5)/10.0)*10;
      }else{
        c1 = c;
      }
      if(d % 10 != 0){
       d1 = (int)Math.round((d+5)/10.0)*10;
      }else{
        d1 = d;
      }
      if(e % 10 != 0){
       e1 = (int)Math.round((e+5)/10.0)*10;
      }else{
        e1 = e;
      }
      
      int ans = a1 + b1 + c1 + d1 + e1;
      
      int a2 = a1 - a;
      int b2 = b1 - b;
      int c2 = c1 - c;
      int d2 = d1 - d;
      int e2 = e1 - e;
      
      int[] list = {a2,b2,c2,d2,e2};
      
      int intMax = list[0];
      for(int i = 1; i < list.length; i++){
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      }
      int answer = ans - intMax;
      System.out.println(answer);
      
    } int a1 = 0; a1 0 int b1 = 0; b1 0 int c1 = 0; c1 0 int d1 = 0; d1 0 int e1 = 0; e1 0 if(a % 10 != 0){
       a1 = (int)Math.round((a+5)/10.0)*10;
      }else{
        a1 = a;
      } a % 10 != 0 a % 10 a 10 0 {
       a1 = (int)Math.round((a+5)/10.0)*10;
      } a1 = (int)Math.round((a+5)/10.0)*10 a1 (int)Math.round((a+5)/10.0)*10 (int)Math.round((a+5)/10.0) Math.round Math (a+5)/10.0 (a+5) a 5 10.0 10 {
        a1 = a;
      } a1 = a a1 a if(b % 10 != 0){
       b1 = (int)Math.round((b+5)/10.0)*10;
      }else{
        b1 = b;
      } b % 10 != 0 b % 10 b 10 0 {
       b1 = (int)Math.round((b+5)/10.0)*10;
      } b1 = (int)Math.round((b+5)/10.0)*10 b1 (int)Math.round((b+5)/10.0)*10 (int)Math.round((b+5)/10.0) Math.round Math (b+5)/10.0 (b+5) b 5 10.0 10 {
        b1 = b;
      } b1 = b b1 b if(c % 10 != 0){
       c1 = (int)Math.round((c+5)/10.0)*10;
      }else{
        c1 = c;
      } c % 10 != 0 c % 10 c 10 0 {
       c1 = (int)Math.round((c+5)/10.0)*10;
      } c1 = (int)Math.round((c+5)/10.0)*10 c1 (int)Math.round((c+5)/10.0)*10 (int)Math.round((c+5)/10.0) Math.round Math (c+5)/10.0 (c+5) c 5 10.0 10 {
        c1 = c;
      } c1 = c c1 c if(d % 10 != 0){
       d1 = (int)Math.round((d+5)/10.0)*10;
      }else{
        d1 = d;
      } d % 10 != 0 d % 10 d 10 0 {
       d1 = (int)Math.round((d+5)/10.0)*10;
      } d1 = (int)Math.round((d+5)/10.0)*10 d1 (int)Math.round((d+5)/10.0)*10 (int)Math.round((d+5)/10.0) Math.round Math (d+5)/10.0 (d+5) d 5 10.0 10 {
        d1 = d;
      } d1 = d d1 d if(e % 10 != 0){
       e1 = (int)Math.round((e+5)/10.0)*10;
      }else{
        e1 = e;
      } e % 10 != 0 e % 10 e 10 0 {
       e1 = (int)Math.round((e+5)/10.0)*10;
      } e1 = (int)Math.round((e+5)/10.0)*10 e1 (int)Math.round((e+5)/10.0)*10 (int)Math.round((e+5)/10.0) Math.round Math (e+5)/10.0 (e+5) e 5 10.0 10 {
        e1 = e;
      } e1 = e e1 e int ans = a1 + b1 + c1 + d1 + e1; ans a1 + b1 + c1 + d1 + e1 d1 c1 a1 + b1 + c1 + d1 + e1 a1 b1 c1 d1 e1 int a2 = a1 - a; a2 a1 - a a1 a int b2 = b1 - b; b2 b1 - b b1 b int c2 = c1 - c; c2 c1 - c c1 c int d2 = d1 - d; d2 d1 - d d1 d int e2 = e1 - e; e2 e1 - e e1 e int[] list = {a2,b2,c2,d2,e2}; list {a2,b2,c2,d2,e2} a2 b2 c2 d2 e2 int intMax = list[0]; intMax list[0] list 0 for(int i = 1; i < list.length; i++){
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      } int i = 1; int i = 1; i 1 i < list.length i list.length list list.length i++ i++ i {
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      } {
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      } if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        } intMax < list[i] && intMax != 10 && list[i] != 10 intMax < list[i] && intMax != 10 && list[i] != 10 intMax < list[i] intMax list[i] list i intMax != 10 intMax 10 list[i] != 10 list[i] list i 10 {
          intMax = list[i];
        } intMax = list[i] intMax list[i] list i int answer = ans - intMax; answer ans - intMax ans intMax System.out.println(answer) System.out.println System.out System System.out answer {
       System.out.println("入力範囲に違反しています");
    } System.out.println("入力範囲に違反しています") System.out.println System.out System System.out "入力範囲に違反しています" 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();
    
    if(a<=123 && a>=1 && b<=123 && b>=1 && c<=123 && c>=1 
       && d<=123 && d>=1 && e<=123 && e>=1){
        int a1 = 0;
      int b1 = 0;
      int c1 = 0;
      int d1 = 0;
      int e1 = 0;
      if(a % 10 != 0){
       a1 = (int)Math.round((a+5)/10.0)*10;
      }else{
        a1 = a;
      }
      if(b % 10 != 0){
       b1 = (int)Math.round((b+5)/10.0)*10;
      }else{
        b1 = b;
      }
      if(c % 10 != 0){
       c1 = (int)Math.round((c+5)/10.0)*10;
      }else{
        c1 = c;
      }
      if(d % 10 != 0){
       d1 = (int)Math.round((d+5)/10.0)*10;
      }else{
        d1 = d;
      }
      if(e % 10 != 0){
       e1 = (int)Math.round((e+5)/10.0)*10;
      }else{
        e1 = e;
      }
      
      int ans = a1 + b1 + c1 + d1 + e1;
      
      int a2 = a1 - a;
      int b2 = b1 - b;
      int c2 = c1 - c;
      int d2 = d1 - d;
      int e2 = e1 - e;
      
      int[] list = {a2,b2,c2,d2,e2};
      
      int intMax = list[0];
      for(int i = 1; i < list.length; i++){
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      }
      int answer = ans - intMax;
      System.out.println(answer);
      
    }else{
       System.out.println("入力範囲に違反しています");
    }
  }
} 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();
    
    if(a<=123 && a>=1 && b<=123 && b>=1 && c<=123 && c>=1 
       && d<=123 && d>=1 && e<=123 && e>=1){
        int a1 = 0;
      int b1 = 0;
      int c1 = 0;
      int d1 = 0;
      int e1 = 0;
      if(a % 10 != 0){
       a1 = (int)Math.round((a+5)/10.0)*10;
      }else{
        a1 = a;
      }
      if(b % 10 != 0){
       b1 = (int)Math.round((b+5)/10.0)*10;
      }else{
        b1 = b;
      }
      if(c % 10 != 0){
       c1 = (int)Math.round((c+5)/10.0)*10;
      }else{
        c1 = c;
      }
      if(d % 10 != 0){
       d1 = (int)Math.round((d+5)/10.0)*10;
      }else{
        d1 = d;
      }
      if(e % 10 != 0){
       e1 = (int)Math.round((e+5)/10.0)*10;
      }else{
        e1 = e;
      }
      
      int ans = a1 + b1 + c1 + d1 + e1;
      
      int a2 = a1 - a;
      int b2 = b1 - b;
      int c2 = c1 - c;
      int d2 = d1 - d;
      int e2 = e1 - e;
      
      int[] list = {a2,b2,c2,d2,e2};
      
      int intMax = list[0];
      for(int i = 1; i < list.length; i++){
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      }
      int answer = ans - intMax;
      System.out.println(answer);
      
    }else{
       System.out.println("入力範囲に違反しています");
    }
  }
} 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();
    
    if(a<=123 && a>=1 && b<=123 && b>=1 && c<=123 && c>=1 
       && d<=123 && d>=1 && e<=123 && e>=1){
        int a1 = 0;
      int b1 = 0;
      int c1 = 0;
      int d1 = 0;
      int e1 = 0;
      if(a % 10 != 0){
       a1 = (int)Math.round((a+5)/10.0)*10;
      }else{
        a1 = a;
      }
      if(b % 10 != 0){
       b1 = (int)Math.round((b+5)/10.0)*10;
      }else{
        b1 = b;
      }
      if(c % 10 != 0){
       c1 = (int)Math.round((c+5)/10.0)*10;
      }else{
        c1 = c;
      }
      if(d % 10 != 0){
       d1 = (int)Math.round((d+5)/10.0)*10;
      }else{
        d1 = d;
      }
      if(e % 10 != 0){
       e1 = (int)Math.round((e+5)/10.0)*10;
      }else{
        e1 = e;
      }
      
      int ans = a1 + b1 + c1 + d1 + e1;
      
      int a2 = a1 - a;
      int b2 = b1 - b;
      int c2 = c1 - c;
      int d2 = d1 - d;
      int e2 = e1 - e;
      
      int[] list = {a2,b2,c2,d2,e2};
      
      int intMax = list[0];
      for(int i = 1; i < list.length; i++){
        if(intMax < list[i] && intMax != 10 && list[i] != 10){
          intMax = list[i];
        }
      }
      int answer = ans - intMax;
      System.out.println(answer);
      
    }else{
       System.out.println("入力範囲に違反しています");
    }
  }
}