I. Cutting Trees
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

While sitting on a call about live coding on the topic of "trees", two programmers from "Kanda Software" started playing a game on paper — drawing trees. Naturally, not green ones with leaves, but graphs.

They started with a tree consisting of a single vertex numbered $$$1$$$. Then they added a vertex numbered $$$2$$$ and connected them with an edge, resulting in the second tree, and they named vertex number $$$2$$$ its root.

Then they agreed that each subsequent $$$n$$$-th tree would be constructed from the $$$(n - 1)$$$-th tree using the following procedure:

  • In the $$$(n - 1)$$$-th tree, a path is constructed from the root of the tree to some leaf such that at each step, a child vertex with the highest number is chosen;
  • All edges belonging to the constructed path are removed;
  • All vertices belonging to the constructed path are connected, each with one edge to a new vertex numbered $$$n$$$;
  • The vertex numbered $$$n$$$ becomes the root of the $$$n$$$-th tree.

After several trees, they ran out of space on the paper, and they decided to stop drawing and start counting, posing problems to each other to compute characteristics of their sequence of trees.

One would think of two numbers, $$$n$$$ and $$$v$$$, and the other had to calculate the sum of the vertex numbers on the shortest path from the root of the $$$n$$$-th tree to vertex $$$v$$$ (including both the starting and ending vertices).

At this point, Slava noticed their game and suggested that for better understanding of the material, they compute the required sum for sufficiently large values of $$$n$$$. Naturally, performing such complex calculations on paper is impossible. Help them do this.

Input

The first line contains two integers $$$n$$$ and $$$v$$$ $$$(1 \le v \le n \le 10^{18})$$$ — the number of the tree and the number of the vertex in the tree, respectively.

Output

In a single line, output the integer $$$S$$$ – the sum of the vertex numbers on the shortest path from the root of the $$$n$$$-th tree to vertex $$$v$$$ (including both the starting and ending vertices).

It is guaranteed that $$$S$$$ does not exceed $$$9 \cdot 10^{18}$$$.

Examples
Input
2 1
Output
3
Input
3 2
Output
5
Input
6 1
Output
12
Input
9 6
Output
23
Note

The $$$2$$$-nd and $$$3$$$-rd trees, respectively.

The $$$6$$$-th and $$$9$$$-th trees, respectively.

First test example

The sum of the vertex numbers on the path is $$$2 + 1 = 3$$$.

Second test example

The sum of the vertex numbers on the path is $$$3 + 2 = 5$$$.

Third test example

The sum of the vertex numbers on the path is $$$6 + 5 + 1 = 12$$$.

Fourth test example

The sum of the vertex numbers on the path is $$$9 + 8 + 6 = 23$$$.