import java.util.*;
import java.lang.*;

public class Main{
    
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        int[] p = new int[5];
        
        for (int i = 0; i < 5; i++) {
            p[i] = sc.nextInt();
        }
        
        int ans = 0;
        int min = Integer.MAX_VALUE;
        int minrest = Integer.MAX_VALUE;
        
        
        
        for (int i = 0; i < 5; i++) {
            int rest = p[i] % 10;
            if (rest < minrest && rest != 0) {
                minrest = rest;
                min = i;
            }
        }
        
        for (int i = 0; i < 5; i++) {
            if (i != min && p[i] % 10 != 0) {
                p[i] += 10 - p[i] % 10;
            }
            ans += p[i];
        }
        
        System.out.println(ans);

    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main{
    
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        int[] p = new int[5];
        
        for (int i = 0; i < 5; i++) {
            p[i] = sc.nextInt();
        }
        
        int ans = 0;
        int min = Integer.MAX_VALUE;
        int minrest = Integer.MAX_VALUE;
        
        
        
        for (int i = 0; i < 5; i++) {
            int rest = p[i] % 10;
            if (rest < minrest && rest != 0) {
                minrest = rest;
                min = i;
            }
        }
        
        for (int i = 0; i < 5; i++) {
            if (i != min && p[i] % 10 != 0) {
                p[i] += 10 - p[i] % 10;
            }
            ans += p[i];
        }
        
        System.out.println(ans);

    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        int[] p = new int[5];
        
        for (int i = 0; i < 5; i++) {
            p[i] = sc.nextInt();
        }
        
        int ans = 0;
        int min = Integer.MAX_VALUE;
        int minrest = Integer.MAX_VALUE;
        
        
        
        for (int i = 0; i < 5; i++) {
            int rest = p[i] % 10;
            if (rest < minrest && rest != 0) {
                minrest = rest;
                min = i;
            }
        }
        
        for (int i = 0; i < 5; i++) {
            if (i != min && p[i] % 10 != 0) {
                p[i] += 10 - p[i] % 10;
            }
            ans += p[i];
        }
        
        System.out.println(ans);

    } main {
        Scanner sc = new Scanner(System.in);
        
        int[] p = new int[5];
        
        for (int i = 0; i < 5; i++) {
            p[i] = sc.nextInt();
        }
        
        int ans = 0;
        int min = Integer.MAX_VALUE;
        int minrest = Integer.MAX_VALUE;
        
        
        
        for (int i = 0; i < 5; i++) {
            int rest = p[i] % 10;
            if (rest < minrest && rest != 0) {
                minrest = rest;
                min = i;
            }
        }
        
        for (int i = 0; i < 5; i++) {
            if (i != min && p[i] % 10 != 0) {
                p[i] += 10 - p[i] % 10;
            }
            ans += p[i];
        }
        
        System.out.println(ans);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] p = new int[5]; p new int[5] 5 for (int i = 0; i < 5; i++) {
            p[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            p[i] = sc.nextInt();
        } {
            p[i] = sc.nextInt();
        } p[i] = sc.nextInt() p[i] p i sc.nextInt() sc.nextInt sc int ans = 0; ans 0 int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int minrest = Integer.MAX_VALUE; minrest Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i < 5; i++) {
            int rest = p[i] % 10;
            if (rest < minrest && rest != 0) {
                minrest = rest;
                min = i;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            int rest = p[i] % 10;
            if (rest < minrest && rest != 0) {
                minrest = rest;
                min = i;
            }
        } {
            int rest = p[i] % 10;
            if (rest < minrest && rest != 0) {
                minrest = rest;
                min = i;
            }
        } int rest = p[i] % 10; rest p[i] % 10 p[i] p i 10 if (rest < minrest && rest != 0) {
                minrest = rest;
                min = i;
            } rest < minrest && rest != 0 rest < minrest rest minrest rest != 0 rest 0 {
                minrest = rest;
                min = i;
            } minrest = rest minrest rest min = i min i for (int i = 0; i < 5; i++) {
            if (i != min && p[i] % 10 != 0) {
                p[i] += 10 - p[i] % 10;
            }
            ans += p[i];
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if (i != min && p[i] % 10 != 0) {
                p[i] += 10 - p[i] % 10;
            }
            ans += p[i];
        } {
            if (i != min && p[i] % 10 != 0) {
                p[i] += 10 - p[i] % 10;
            }
            ans += p[i];
        } if (i != min && p[i] % 10 != 0) {
                p[i] += 10 - p[i] % 10;
            } i != min && p[i] % 10 != 0 i != min i min p[i] % 10 != 0 p[i] % 10 p[i] p i 10 0 {
                p[i] += 10 - p[i] % 10;
            } p[i] += 10 - p[i] % 10 p[i] p i 10 - p[i] % 10 10 p[i] % 10 p[i] p i 10 ans += p[i] ans p[i] p 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[] p = new int[5];
        
        for (int i = 0; i < 5; i++) {
            p[i] = sc.nextInt();
        }
        
        int ans = 0;
        int min = Integer.MAX_VALUE;
        int minrest = Integer.MAX_VALUE;
        
        
        
        for (int i = 0; i < 5; i++) {
            int rest = p[i] % 10;
            if (rest < minrest && rest != 0) {
                minrest = rest;
                min = i;
            }
        }
        
        for (int i = 0; i < 5; i++) {
            if (i != min && p[i] % 10 != 0) {
                p[i] += 10 - p[i] % 10;
            }
            ans += p[i];
        }
        
        System.out.println(ans);

    }
} public class Main{
    
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        int[] p = new int[5];
        
        for (int i = 0; i < 5; i++) {
            p[i] = sc.nextInt();
        }
        
        int ans = 0;
        int min = Integer.MAX_VALUE;
        int minrest = Integer.MAX_VALUE;
        
        
        
        for (int i = 0; i < 5; i++) {
            int rest = p[i] % 10;
            if (rest < minrest && rest != 0) {
                minrest = rest;
                min = i;
            }
        }
        
        for (int i = 0; i < 5; i++) {
            if (i != min && p[i] % 10 != 0) {
                p[i] += 10 - p[i] % 10;
            }
            ans += p[i];
        }
        
        System.out.println(ans);

    }
} Main
import java.util.*;
import java.lang.*;

public class Main{
    
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        int[] p = new int[5];
        
        for (int i = 0; i < 5; i++) {
            p[i] = sc.nextInt();
        }
        
        int ans = 0;
        int min = Integer.MAX_VALUE;
        int minrest = Integer.MAX_VALUE;
        
        
        
        for (int i = 0; i < 5; i++) {
            int rest = p[i] % 10;
            if (rest < minrest && rest != 0) {
                minrest = rest;
                min = i;
            }
        }
        
        for (int i = 0; i < 5; i++) {
            if (i != min && p[i] % 10 != 0) {
                p[i] += 10 - p[i] % 10;
            }
            ans += p[i];
        }
        
        System.out.println(ans);

    }
}
