import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        int ans = 0;
        ArrayList<Integer> ansList = new ArrayList<Integer>();
        ArrayList<Integer> iList = new ArrayList<Integer>();
        
        Scanner scan = new Scanner(System.in);

        for(int i = 0; i < 5 ; i++) {
            int num = scan.nextInt();
            if (num % 10 == 0) {
                ansList.add(num);
            } else {
                iList.add(num);
            }
        }
        
        ArrayList<Integer> iOneList = new ArrayList<Integer>();
        ArrayList<Integer> iTenList = new ArrayList<Integer>();
        
        for(int iListData : iList) {
            iOneList.add(iListData % 10);
            ansList.add(iListData - (iListData % 10));
        }
        
        if (iOneList.size() != 0) {
            Collections.sort(iOneList);
    
            ansList.add(iOneList.get(0));
            for(int i = 1; i < iOneList.size(); i++) {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            }
        }
        
        for(int num : ansList) {
            ans = ans + num;
        }
        
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        int ans = 0;
        ArrayList<Integer> ansList = new ArrayList<Integer>();
        ArrayList<Integer> iList = new ArrayList<Integer>();
        
        Scanner scan = new Scanner(System.in);

        for(int i = 0; i < 5 ; i++) {
            int num = scan.nextInt();
            if (num % 10 == 0) {
                ansList.add(num);
            } else {
                iList.add(num);
            }
        }
        
        ArrayList<Integer> iOneList = new ArrayList<Integer>();
        ArrayList<Integer> iTenList = new ArrayList<Integer>();
        
        for(int iListData : iList) {
            iOneList.add(iListData % 10);
            ansList.add(iListData - (iListData % 10));
        }
        
        if (iOneList.size() != 0) {
            Collections.sort(iOneList);
    
            ansList.add(iOneList.get(0));
            for(int i = 1; i < iOneList.size(); i++) {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            }
        }
        
        for(int num : ansList) {
            ans = ans + num;
        }
        
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        int ans = 0;
        ArrayList<Integer> ansList = new ArrayList<Integer>();
        ArrayList<Integer> iList = new ArrayList<Integer>();
        
        Scanner scan = new Scanner(System.in);

        for(int i = 0; i < 5 ; i++) {
            int num = scan.nextInt();
            if (num % 10 == 0) {
                ansList.add(num);
            } else {
                iList.add(num);
            }
        }
        
        ArrayList<Integer> iOneList = new ArrayList<Integer>();
        ArrayList<Integer> iTenList = new ArrayList<Integer>();
        
        for(int iListData : iList) {
            iOneList.add(iListData % 10);
            ansList.add(iListData - (iListData % 10));
        }
        
        if (iOneList.size() != 0) {
            Collections.sort(iOneList);
    
            ansList.add(iOneList.get(0));
            for(int i = 1; i < iOneList.size(); i++) {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            }
        }
        
        for(int num : ansList) {
            ans = ans + num;
        }
        
        System.out.println(ans);
    } main {
        int ans = 0;
        ArrayList<Integer> ansList = new ArrayList<Integer>();
        ArrayList<Integer> iList = new ArrayList<Integer>();
        
        Scanner scan = new Scanner(System.in);

        for(int i = 0; i < 5 ; i++) {
            int num = scan.nextInt();
            if (num % 10 == 0) {
                ansList.add(num);
            } else {
                iList.add(num);
            }
        }
        
        ArrayList<Integer> iOneList = new ArrayList<Integer>();
        ArrayList<Integer> iTenList = new ArrayList<Integer>();
        
        for(int iListData : iList) {
            iOneList.add(iListData % 10);
            ansList.add(iListData - (iListData % 10));
        }
        
        if (iOneList.size() != 0) {
            Collections.sort(iOneList);
    
            ansList.add(iOneList.get(0));
            for(int i = 1; i < iOneList.size(); i++) {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            }
        }
        
        for(int num : ansList) {
            ans = ans + num;
        }
        
        System.out.println(ans);
    } int ans = 0; ans 0 ArrayList<Integer> ansList = new ArrayList<Integer>(); ansList new ArrayList<Integer>() ArrayList<Integer> iList = new ArrayList<Integer>(); iList new ArrayList<Integer>() Scanner scan = new Scanner(System.in); scan new Scanner(System.in) for(int i = 0; i < 5 ; i++) {
            int num = scan.nextInt();
            if (num % 10 == 0) {
                ansList.add(num);
            } else {
                iList.add(num);
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            int num = scan.nextInt();
            if (num % 10 == 0) {
                ansList.add(num);
            } else {
                iList.add(num);
            }
        } {
            int num = scan.nextInt();
            if (num % 10 == 0) {
                ansList.add(num);
            } else {
                iList.add(num);
            }
        } int num = scan.nextInt(); num scan.nextInt() scan.nextInt scan if (num % 10 == 0) {
                ansList.add(num);
            } else {
                iList.add(num);
            } num % 10 == 0 num % 10 num 10 0 {
                ansList.add(num);
            } ansList.add(num) ansList.add ansList num {
                iList.add(num);
            } iList.add(num) iList.add iList num ArrayList<Integer> iOneList = new ArrayList<Integer>(); iOneList new ArrayList<Integer>() ArrayList<Integer> iTenList = new ArrayList<Integer>(); iTenList new ArrayList<Integer>() for(int iListData : iList) {
            iOneList.add(iListData % 10);
            ansList.add(iListData - (iListData % 10));
        } int iListData iList {
            iOneList.add(iListData % 10);
            ansList.add(iListData - (iListData % 10));
        } {
            iOneList.add(iListData % 10);
            ansList.add(iListData - (iListData % 10));
        } iOneList.add(iListData % 10) iOneList.add iOneList iListData % 10 iListData 10 ansList.add(iListData - (iListData % 10)) ansList.add ansList iListData - (iListData % 10) iListData (iListData % 10) iListData 10 if (iOneList.size() != 0) {
            Collections.sort(iOneList);
    
            ansList.add(iOneList.get(0));
            for(int i = 1; i < iOneList.size(); i++) {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            }
        } iOneList.size() != 0 iOneList.size() iOneList.size iOneList 0 {
            Collections.sort(iOneList);
    
            ansList.add(iOneList.get(0));
            for(int i = 1; i < iOneList.size(); i++) {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            }
        } Collections.sort(iOneList) Collections.sort Collections iOneList ansList.add(iOneList.get(0)) ansList.add ansList iOneList.get(0) iOneList.get iOneList 0 for(int i = 1; i < iOneList.size(); i++) {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            } int i = 1; int i = 1; i 1 i < iOneList.size() i iOneList.size() iOneList.size iOneList i++ i++ i {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            } {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            } ansList.add(iOneList.get(i) + (10 - iOneList.get(i))) ansList.add ansList iOneList.get(i) + (10 - iOneList.get(i)) iOneList.get(i) iOneList.get iOneList i (10 - iOneList.get(i)) 10 iOneList.get(i) iOneList.get iOneList i for(int num : ansList) {
            ans = ans + num;
        } int num ansList {
            ans = ans + num;
        } {
            ans = ans + num;
        } ans = ans + num ans ans + num ans num 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) throws Exception {
        int ans = 0;
        ArrayList<Integer> ansList = new ArrayList<Integer>();
        ArrayList<Integer> iList = new ArrayList<Integer>();
        
        Scanner scan = new Scanner(System.in);

        for(int i = 0; i < 5 ; i++) {
            int num = scan.nextInt();
            if (num % 10 == 0) {
                ansList.add(num);
            } else {
                iList.add(num);
            }
        }
        
        ArrayList<Integer> iOneList = new ArrayList<Integer>();
        ArrayList<Integer> iTenList = new ArrayList<Integer>();
        
        for(int iListData : iList) {
            iOneList.add(iListData % 10);
            ansList.add(iListData - (iListData % 10));
        }
        
        if (iOneList.size() != 0) {
            Collections.sort(iOneList);
    
            ansList.add(iOneList.get(0));
            for(int i = 1; i < iOneList.size(); i++) {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            }
        }
        
        for(int num : ansList) {
            ans = ans + num;
        }
        
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        int ans = 0;
        ArrayList<Integer> ansList = new ArrayList<Integer>();
        ArrayList<Integer> iList = new ArrayList<Integer>();
        
        Scanner scan = new Scanner(System.in);

        for(int i = 0; i < 5 ; i++) {
            int num = scan.nextInt();
            if (num % 10 == 0) {
                ansList.add(num);
            } else {
                iList.add(num);
            }
        }
        
        ArrayList<Integer> iOneList = new ArrayList<Integer>();
        ArrayList<Integer> iTenList = new ArrayList<Integer>();
        
        for(int iListData : iList) {
            iOneList.add(iListData % 10);
            ansList.add(iListData - (iListData % 10));
        }
        
        if (iOneList.size() != 0) {
            Collections.sort(iOneList);
    
            ansList.add(iOneList.get(0));
            for(int i = 1; i < iOneList.size(); i++) {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            }
        }
        
        for(int num : ansList) {
            ans = ans + num;
        }
        
        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        int ans = 0;
        ArrayList<Integer> ansList = new ArrayList<Integer>();
        ArrayList<Integer> iList = new ArrayList<Integer>();
        
        Scanner scan = new Scanner(System.in);

        for(int i = 0; i < 5 ; i++) {
            int num = scan.nextInt();
            if (num % 10 == 0) {
                ansList.add(num);
            } else {
                iList.add(num);
            }
        }
        
        ArrayList<Integer> iOneList = new ArrayList<Integer>();
        ArrayList<Integer> iTenList = new ArrayList<Integer>();
        
        for(int iListData : iList) {
            iOneList.add(iListData % 10);
            ansList.add(iListData - (iListData % 10));
        }
        
        if (iOneList.size() != 0) {
            Collections.sort(iOneList);
    
            ansList.add(iOneList.get(0));
            for(int i = 1; i < iOneList.size(); i++) {
                ansList.add(iOneList.get(i) + (10 - iOneList.get(i)));
            }
        }
        
        for(int num : ansList) {
            ans = ans + num;
        }
        
        System.out.println(ans);
    }
}
