import java.util.*;
public class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int res = 0, current = 10;
      while(sc.hasNext()){
        int a = sc.nextInt();
        if(a%10 == 0){res-=10;}
        else if(a%10 < current){current = a%10;}
        
        res += (a/10+1)*10;
      }
      System.out.println(res - 10 + current);
    }
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int res = 0, current = 10;
      while(sc.hasNext()){
        int a = sc.nextInt();
        if(a%10 == 0){res-=10;}
        else if(a%10 < current){current = a%10;}
        
        res += (a/10+1)*10;
      }
      System.out.println(res - 10 + current);
    }
} Main public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int res = 0, current = 10;
      while(sc.hasNext()){
        int a = sc.nextInt();
        if(a%10 == 0){res-=10;}
        else if(a%10 < current){current = a%10;}
        
        res += (a/10+1)*10;
      }
      System.out.println(res - 10 + current);
    } main {
      Scanner sc = new Scanner(System.in);
      int res = 0, current = 10;
      while(sc.hasNext()){
        int a = sc.nextInt();
        if(a%10 == 0){res-=10;}
        else if(a%10 < current){current = a%10;}
        
        res += (a/10+1)*10;
      }
      System.out.println(res - 10 + current);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int res = 0 res 0 current = 10; current 10 while(sc.hasNext()){
        int a = sc.nextInt();
        if(a%10 == 0){res-=10;}
        else if(a%10 < current){current = a%10;}
        
        res += (a/10+1)*10;
      } sc.hasNext() sc.hasNext sc {
        int a = sc.nextInt();
        if(a%10 == 0){res-=10;}
        else if(a%10 < current){current = a%10;}
        
        res += (a/10+1)*10;
      } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if(a%10 == 0){res-=10;}
        else if(a%10 < current){current = a%10;} a%10 == 0 a%10 a 10 0 {res-=10;} res-=10 res 10 if(a%10 < current){current = a%10;} a%10 < current a%10 a 10 current {current = a%10;} current = a%10 current a%10 a 10 res += (a/10+1)*10 res (a/10+1)*10 (a/10+1) a/10 a 10 1 10 System.out.println(res - 10 + current) System.out.println System.out System System.out res - 10 + current res - 10 res 10 current String[] args args public class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int res = 0, current = 10;
      while(sc.hasNext()){
        int a = sc.nextInt();
        if(a%10 == 0){res-=10;}
        else if(a%10 < current){current = a%10;}
        
        res += (a/10+1)*10;
      }
      System.out.println(res - 10 + current);
    }
} public class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int res = 0, current = 10;
      while(sc.hasNext()){
        int a = sc.nextInt();
        if(a%10 == 0){res-=10;}
        else if(a%10 < current){current = a%10;}
        
        res += (a/10+1)*10;
      }
      System.out.println(res - 10 + current);
    }
} Main
import java.util.*;
public class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int res = 0, current = 10;
      while(sc.hasNext()){
        int a = sc.nextInt();
        if(a%10 == 0){res-=10;}
        else if(a%10 < current){current = a%10;}
        
        res += (a/10+1)*10;
      }
      System.out.println(res - 10 + current);
    }
}