Code Submission Evaluation System Login

CSES Problem Set

Number Grid


Task | Statistics


CSES - Number Grid

Time limit:1.00 s Memory limit:512 MB

Consider a two-dimensional grid whose rows and columns are $1$-indexed. Each square contains the smallest nonnegative integer that does not appear to the left on the same row of above on the same column.

Your task is to calculate the value at square $(y,x)$.

Input

The only input line contains two integers $y$ and $x$.

Output

Print one integer: the value at square $(y,x)$.

Constraints
Example

Input:
3 5

Output:
6