import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b= scan.nextInt();
        int c= scan.nextInt();
        int d= scan.nextInt();
        System.out.printf("%.1f", a * 0.2 + b * 0.1 + c * 0.2 + d * 0.5);
    }
}