#D1052. Maximum Sum

    ID: 873 Type: Default 2000ms 268MiB

Maximum Sum

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

inputFormat

Input

Input is given from Standard Input in the following format:

A B C K

outputFormat

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