import java.io.*;
import java.util.Arrays;

public class Main {
    private static int[] pos = new int[5];
    private static int k;

    private static int solver() {
        int idx=0;
        int min=10;

        for(int i=0; i<5;i++){
            int rem = pos[i] % 10;
            if(rem != 0  && rem < min){
                min = rem;
                idx = i;
            }
        }

        int sum=0;
        for(int i=0; i<5;i++){
            if(i==idx){
                sum+=pos[i];
            }else{
                sum+=((pos[i] + 9) / 10)*10;
            }
        }

        return sum;

    }


    public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);

        try {
            for(int i=0; i<5; i++) {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println(solver());

    }
} import java.io.*; io.* java import java.util.Arrays; Arrays java.util public class Main {
    private static int[] pos = new int[5];
    private static int k;

    private static int solver() {
        int idx=0;
        int min=10;

        for(int i=0; i<5;i++){
            int rem = pos[i] % 10;
            if(rem != 0  && rem < min){
                min = rem;
                idx = i;
            }
        }

        int sum=0;
        for(int i=0; i<5;i++){
            if(i==idx){
                sum+=pos[i];
            }else{
                sum+=((pos[i] + 9) / 10)*10;
            }
        }

        return sum;

    }


    public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);

        try {
            for(int i=0; i<5; i++) {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println(solver());

    }
} Main private static int[] pos = new int[5]; pos new int[5] 5 private static int k; k private static int solver() {
        int idx=0;
        int min=10;

        for(int i=0; i<5;i++){
            int rem = pos[i] % 10;
            if(rem != 0  && rem < min){
                min = rem;
                idx = i;
            }
        }

        int sum=0;
        for(int i=0; i<5;i++){
            if(i==idx){
                sum+=pos[i];
            }else{
                sum+=((pos[i] + 9) / 10)*10;
            }
        }

        return sum;

    } solver {
        int idx=0;
        int min=10;

        for(int i=0; i<5;i++){
            int rem = pos[i] % 10;
            if(rem != 0  && rem < min){
                min = rem;
                idx = i;
            }
        }

        int sum=0;
        for(int i=0; i<5;i++){
            if(i==idx){
                sum+=pos[i];
            }else{
                sum+=((pos[i] + 9) / 10)*10;
            }
        }

        return sum;

    } int idx=0; idx 0 int min=10; min 10 for(int i=0; i<5;i++){
            int rem = pos[i] % 10;
            if(rem != 0  && rem < min){
                min = rem;
                idx = i;
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            int rem = pos[i] % 10;
            if(rem != 0  && rem < min){
                min = rem;
                idx = i;
            }
        } {
            int rem = pos[i] % 10;
            if(rem != 0  && rem < min){
                min = rem;
                idx = i;
            }
        } int rem = pos[i] % 10; rem pos[i] % 10 pos[i] pos i 10 if(rem != 0  && rem < min){
                min = rem;
                idx = i;
            } rem != 0  && rem < min rem != 0 rem 0 rem < min rem min {
                min = rem;
                idx = i;
            } min = rem min rem idx = i idx i int sum=0; sum 0 for(int i=0; i<5;i++){
            if(i==idx){
                sum+=pos[i];
            }else{
                sum+=((pos[i] + 9) / 10)*10;
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            if(i==idx){
                sum+=pos[i];
            }else{
                sum+=((pos[i] + 9) / 10)*10;
            }
        } {
            if(i==idx){
                sum+=pos[i];
            }else{
                sum+=((pos[i] + 9) / 10)*10;
            }
        } if(i==idx){
                sum+=pos[i];
            }else{
                sum+=((pos[i] + 9) / 10)*10;
            } i==idx i idx {
                sum+=pos[i];
            } sum+=pos[i] sum pos[i] pos i {
                sum+=((pos[i] + 9) / 10)*10;
            } sum+=((pos[i] + 9) / 10)*10 sum ((pos[i] + 9) / 10)*10 ((pos[i] + 9) / 10) (pos[i] + 9) pos[i] pos i 9 10 10 return sum; sum public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);

        try {
            for(int i=0; i<5; i++) {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println(solver());

    } main {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);

        try {
            for(int i=0; i<5; i++) {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println(solver());

    } InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader br = new BufferedReader(is); br new BufferedReader(is) try {
            for(int i=0; i<5; i++) {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } Exception e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            for(int i=0; i<5; i++) {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            }
        } for(int i=0; i<5; i++) {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            } {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            } String[] inputArray = br.readLine().split(" "); inputArray br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " pos[i] = Integer.parseInt(inputArray[0]) pos[i] pos i Integer.parseInt(inputArray[0]) Integer.parseInt Integer inputArray[0] inputArray 0 System.out.println(solver()) System.out.println System.out System System.out solver() solver String[] args args public class Main {
    private static int[] pos = new int[5];
    private static int k;

    private static int solver() {
        int idx=0;
        int min=10;

        for(int i=0; i<5;i++){
            int rem = pos[i] % 10;
            if(rem != 0  && rem < min){
                min = rem;
                idx = i;
            }
        }

        int sum=0;
        for(int i=0; i<5;i++){
            if(i==idx){
                sum+=pos[i];
            }else{
                sum+=((pos[i] + 9) / 10)*10;
            }
        }

        return sum;

    }


    public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);

        try {
            for(int i=0; i<5; i++) {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println(solver());

    }
} public class Main {
    private static int[] pos = new int[5];
    private static int k;

    private static int solver() {
        int idx=0;
        int min=10;

        for(int i=0; i<5;i++){
            int rem = pos[i] % 10;
            if(rem != 0  && rem < min){
                min = rem;
                idx = i;
            }
        }

        int sum=0;
        for(int i=0; i<5;i++){
            if(i==idx){
                sum+=pos[i];
            }else{
                sum+=((pos[i] + 9) / 10)*10;
            }
        }

        return sum;

    }


    public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);

        try {
            for(int i=0; i<5; i++) {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println(solver());

    }
} Main
import java.io.*;
import java.util.Arrays;

public class Main {
    private static int[] pos = new int[5];
    private static int k;

    private static int solver() {
        int idx=0;
        int min=10;

        for(int i=0; i<5;i++){
            int rem = pos[i] % 10;
            if(rem != 0  && rem < min){
                min = rem;
                idx = i;
            }
        }

        int sum=0;
        for(int i=0; i<5;i++){
            if(i==idx){
                sum+=pos[i];
            }else{
                sum+=((pos[i] + 9) / 10)*10;
            }
        }

        return sum;

    }


    public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);

        try {
            for(int i=0; i<5; i++) {
                String[] inputArray = br.readLine().split(" ");
                pos[i] = Integer.parseInt(inputArray[0]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println(solver());

    }
}