def solve():
    num = list(map(int, input().split()))
    K = int(input())
    num.sort()
    print(num[0] + num[1] + num[2] * 2 ** K)


if __name__ == "__main__":
    solve()

0ea36dea0dd93229c25e3cd1befac84fc5b7948c
<mask token>

def solve():
    num = list(map(int, input().split()))
    K = int(input())
    num.sort()
    print(num[0] + num[1] + num[2] * 2 ** K)


<mask token>

def solve():
    num = list(map(int, input().split()))
    K = int(input())
    num.sort()
    print(num[0] + num[1] + num[2] * 2 ** K)


if __name__ == '__main__':
    solve()

def solve():
    num = list(map(int, input().split()))
    K = int(input())
    num.sort()
    print(num[0] + num[1] + num[2] * 2 ** K)


if __name__ == "__main__":
    solve()
