import java.util.*;
import java.util.Collections;
import java.util.ArrayList;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int[] x = new int[5];
        int ans = 0;
        ArrayList<Integer> list = new ArrayList<Integer>();

        for(int i=0; i<5; i++){
            x[i] = sc.nextInt();
            for(int j=0; j<=130; j += 10){
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            }
            ans += x[i];
        }
        Collections.sort(list);

        for(int i=0; i<4; i++){
            ans += list.get(i);
        }
        System.out.println(ans);

    }
} import java.util.*; util.* java import java.util.Collections; Collections java.util import java.util.ArrayList; ArrayList java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int[] x = new int[5];
        int ans = 0;
        ArrayList<Integer> list = new ArrayList<Integer>();

        for(int i=0; i<5; i++){
            x[i] = sc.nextInt();
            for(int j=0; j<=130; j += 10){
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            }
            ans += x[i];
        }
        Collections.sort(list);

        for(int i=0; i<4; i++){
            ans += list.get(i);
        }
        System.out.println(ans);

    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int[] x = new int[5];
        int ans = 0;
        ArrayList<Integer> list = new ArrayList<Integer>();

        for(int i=0; i<5; i++){
            x[i] = sc.nextInt();
            for(int j=0; j<=130; j += 10){
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            }
            ans += x[i];
        }
        Collections.sort(list);

        for(int i=0; i<4; i++){
            ans += list.get(i);
        }
        System.out.println(ans);

    } main {
        Scanner sc = new Scanner(System.in);

        int[] x = new int[5];
        int ans = 0;
        ArrayList<Integer> list = new ArrayList<Integer>();

        for(int i=0; i<5; i++){
            x[i] = sc.nextInt();
            for(int j=0; j<=130; j += 10){
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            }
            ans += x[i];
        }
        Collections.sort(list);

        for(int i=0; i<4; i++){
            ans += list.get(i);
        }
        System.out.println(ans);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] x = new int[5]; x new int[5] 5 int ans = 0; ans 0 ArrayList<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() for(int i=0; i<5; i++){
            x[i] = sc.nextInt();
            for(int j=0; j<=130; j += 10){
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            }
            ans += x[i];
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            x[i] = sc.nextInt();
            for(int j=0; j<=130; j += 10){
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            }
            ans += x[i];
        } {
            x[i] = sc.nextInt();
            for(int j=0; j<=130; j += 10){
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            }
            ans += x[i];
        } x[i] = sc.nextInt() x[i] x i sc.nextInt() sc.nextInt sc for(int j=0; j<=130; j += 10){
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            } int j=0; int j=0; j 0 j<=130 j 130 j += 10 j += 10 j 10 {
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            } {
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            } if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                } j>=x[i] j x[i] x i {
                    list.add(j-x[i]);
                    break;
                } list.add(j-x[i]) list.add list j-x[i] j x[i] x i break; ans += x[i] ans x[i] x i Collections.sort(list) Collections.sort Collections list for(int i=0; i<4; i++){
            ans += list.get(i);
        } int i=0; int i=0; i 0 i<4 i 4 i++ i++ i {
            ans += list.get(i);
        } {
            ans += list.get(i);
        } ans += list.get(i) ans list.get(i) list.get list i 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[] x = new int[5];
        int ans = 0;
        ArrayList<Integer> list = new ArrayList<Integer>();

        for(int i=0; i<5; i++){
            x[i] = sc.nextInt();
            for(int j=0; j<=130; j += 10){
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            }
            ans += x[i];
        }
        Collections.sort(list);

        for(int i=0; i<4; i++){
            ans += list.get(i);
        }
        System.out.println(ans);

    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int[] x = new int[5];
        int ans = 0;
        ArrayList<Integer> list = new ArrayList<Integer>();

        for(int i=0; i<5; i++){
            x[i] = sc.nextInt();
            for(int j=0; j<=130; j += 10){
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            }
            ans += x[i];
        }
        Collections.sort(list);

        for(int i=0; i<4; i++){
            ans += list.get(i);
        }
        System.out.println(ans);

    }
} Main
import java.util.*;
import java.util.Collections;
import java.util.ArrayList;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int[] x = new int[5];
        int ans = 0;
        ArrayList<Integer> list = new ArrayList<Integer>();

        for(int i=0; i<5; i++){
            x[i] = sc.nextInt();
            for(int j=0; j<=130; j += 10){
                if(j>=x[i]){
                    list.add(j-x[i]);
                    break;
                }
            }
            ans += x[i];
        }
        Collections.sort(list);

        for(int i=0; i<4; i++){
            ans += list.get(i);
        }
        System.out.println(ans);

    }
}