P10194 [AtCoder] AtCoder Beginner Contest 096 - Maximum Sum
入门
题目描述

There are three positive integers A, B and C written on a blackboard. E869120 performs the following operation K times:

  • Choose one integer written on the blackboard and let the chosen integer be n. Replace the chosen integer with 2n.

What is the largest possible sum of the integers written on the blackboard after K operations?

Constraints

  • A, B and C are integers between 1 and 50 (inclusive).
  • K is an integer between 1 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:

A B C
K

Output

Print the largest possible sum of the integers written on the blackboard after K operations by E869220.

Examples

Input

5 3 11
1

Output

30

Input

3 3 4
2

Output

22

输入格式

见题面

输出格式

见题面

样例输入
5 3 11 1
样例输出
30