#include "bits/stdc++.h"

using namespace std;

long long dfs(long long K, long long A, long long B, long long C) {
    if (K == 0) {
        return A + B + C;
    }

    long long a = dfs(K - 1, 2 * A, B, C);
    long long b = dfs(K - 1, A, 2 * B, C);
    long long c = dfs(K - 1, A, B, 2 * C);
    return max(max(a, b), c);
}

void Main() {
    long long A, B, C;
    cin >> A >> B >> C;
    long long K;
    cin >> K;

    long long ans = dfs(K, A, B, C);
    cout << ans << endl;
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}

#include<iostream>
#include<string>
#include<map>
#include<algorithm>
using namespace std;
typedef long long ll;
const int Max = 1e3 + 7;
int ls1[Max], ls2[Max];
int n;


int main()
{
	int a, b;
	string str;
	cin >> a >> b;
	cin >> str;
	int f = 0;
	for (int i = 0; i <= str.size() - 1; i++)
	{
		if (i == a)
		{
			if (str[i] != '-')
			{
				f = 1;
				break;
			}
		}
		else
		{
			if (!(str[i] <= '9' && str[i] >= '0'))
			{
				f = 1;
				break;
			}
		}
	}
	if (f)cout << "No";
	else cout << "Yes";
}