import java.util.*;

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

        int time[] = new int[5];
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }

        int index = 0;
        int min = 9;

        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i != index) {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            }
        }

        int result = 0;

        for (int i = 0; i < 5; i++) {
            result = result + time[i];
        }

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

        int time[] = new int[5];
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }

        int index = 0;
        int min = 9;

        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i != index) {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            }
        }

        int result = 0;

        for (int i = 0; i < 5; i++) {
            result = result + time[i];
        }

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

        int time[] = new int[5];
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }

        int index = 0;
        int min = 9;

        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i != index) {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            }
        }

        int result = 0;

        for (int i = 0; i < 5; i++) {
            result = result + time[i];
        }

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

        int time[] = new int[5];
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }

        int index = 0;
        int min = 9;

        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i != index) {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            }
        }

        int result = 0;

        for (int i = 0; i < 5; i++) {
            result = result + time[i];
        }

        System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int time[] = new int[5]; time new int[5] 5 for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            time[i] = sc.nextInt();
        } {
            time[i] = sc.nextInt();
        } time[i] = sc.nextInt() time[i] time i sc.nextInt() sc.nextInt sc int index = 0; index 0 int min = 9; min 9 for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            }
        } {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            }
        } if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            } time[i] % 10 != 0 time[i] % 10 time[i] time i 10 0 {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            } if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                } min > time[i] % 10 min time[i] % 10 time[i] time i 10 {
                    min = time[i] % 10;
                    index = i;
                } min = time[i] % 10 min time[i] % 10 time[i] time i 10 index = i index i for (int i = 0; i < 5; i++) {
            if (i != index) {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if (i != index) {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            }
        } {
            if (i != index) {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            }
        } if (i != index) {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            } i != index i index {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            } if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                } time[i] % 10 != 0 time[i] % 10 time[i] time i 10 0 {
                    time[i] = time[i] - (time[i] % 10) + 10;
                } time[i] = time[i] - (time[i] % 10) + 10 time[i] time i time[i] - (time[i] % 10) + 10 time[i] - (time[i] % 10) time[i] time i (time[i] % 10) time[i] time i 10 10 int result = 0; result 0 for (int i = 0; i < 5; i++) {
            result = result + time[i];
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            result = result + time[i];
        } {
            result = result + time[i];
        } result = result + time[i] result result + time[i] result time[i] time i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

        int time[] = new int[5];
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }

        int index = 0;
        int min = 9;

        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i != index) {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            }
        }

        int result = 0;

        for (int i = 0; i < 5; i++) {
            result = result + time[i];
        }

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

        int time[] = new int[5];
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }

        int index = 0;
        int min = 9;

        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i != index) {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            }
        }

        int result = 0;

        for (int i = 0; i < 5; i++) {
            result = result + time[i];
        }

        System.out.println(result);
	}
} Main
import java.util.*;

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

        int time[] = new int[5];
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }

        int index = 0;
        int min = 9;

        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                    index = i;
                }
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i != index) {
                if (time[i] % 10 != 0) {
                    time[i] = time[i] - (time[i] % 10) + 10;
                }
            }
        }

        int result = 0;

        for (int i = 0; i < 5; i++) {
            result = result + time[i];
        }

        System.out.println(result);
	}
}
