import std.algorithm;
import std.math;
import std.stdio;

struct Nums {
    int a, b, c;

    int sum() {
        return a + b + c;
    }
}

void main() {
    int k;
    Nums nums;
    with (nums) {
        readf("%d %d %d\n%d\n", &a, &b, &c, &k);
    }

    foreach (i; 0..k) {
        with (nums) {
            auto na = Nums(a * 2, b, c);
            auto nb = Nums(a, b * 2, c);
            auto nc = Nums(a, b, c * 2);
            auto m = max(na.sum, nb.sum, nc.sum);
            if (m == na.sum) {
                nums = na;
            } else if (m == nb.sum) {
                nums = nb;
            } else {
                nums = nc;
            }
        }
    }
    write(nums.sum);
}
