#include <stdio.h>
#define MAX_ELEMENTS 30
int main() {
int s[MAX_ELEMENTS];
int n = 0;
long long total_sum = 0;
while (scanf("%d", &s[n]) != EOF) {
n++;
}
for (int i = 0; i < n; i++) {
total_sum += s[i] * (1 << (n - 1));
}
printf("%lld\n", total_sum);
return 0;
}