#include<stdio.h>
int main() {
double a, b, c, d;
double s;
while (scanf("%lf %lf %lf %lf", &a, &b, &c, &d) != EOF) {
s = 0.2 * a + 0.1 * b + 0.2 * c + 0.5 * d;
printf("%.1f", s);
}
return 0;
}

#include<stdio.h>
int main() {
double a, b, c, d;
double s;
while (scanf("%lf %lf %lf %lf", &a, &b, &c, &d) != EOF) {
s = 0.2 * a + 0.1 * b + 0.2 * c + 0.5 * d;
printf("%.1f", s);
}
return 0;
}