#GD0000016. Cộng và nhân (Addition and Multiplication)

Cộng và nhân (Addition and Multiplication)

Addition and Multiplication

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

A board initially displays 11. Perform exactly NN operations. Each operation either doubles the current value or adds KK. Find the minimum possible value after exactly NN operations.

Input

The first line contains NN. The second line contains KK.

Output

Print the minimum possible value.

Subtasks

General constraints:

  • 1≤N,K≤101 \le N,K \le 10.

  • Subtask 1 (20 points): N≤4N \le 4, K≤4K \le 4

  • Subtask 2 (30 points): N≤7N \le 7, K≤7K \le 7

  • Subtask 3 (50 points): No additional constraints.

Examples

Input

4
3

Output

10

Explanation

Starting from 11, choose the smaller next value at every step: 1→2→4→7→101\to2\to4\to7\to10.