#5465. CSES1157 数字网格

0

CSES1157 数字网格

Mex Grid Queries

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 or 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

1y,x1091 \le y,x \le 10^9

Example

Input

3 5

Output

6