시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB141411100.000%

문제

A square has its vertices at the coordinates $(0, 0)$, $(0, 2^N)$, $(2^N , 2^N )$, $(2^N , 0)$. Each vertex has an attractor. A particle is placed initially at position $(2^{N-1} , 2^{N-1})$. Each attractor can be activated individually, any number of times. When an attractor at position $(i, j)$ is activated, if a particle is at position $(p, q)$, it will be moved to the midpoint between $(i, j)$ and $(p, q)$.

Given $N$ and a point $(x, y)$, calculate the least number of times you have to activate the attractors so that the particle ends up at position $(x, y)$.

입력

The input consists of a single line containing three integers $N$, $x$ and $y$, such that $1 ≤ N ≤ 20$ and $0 < x, y < 2^N$.

출력

Print a single line, containing the least number of times you have to active the attractors.

예제 입력 1

1 1 1

예제 출력 1

0

예제 입력 2

4 12 4

예제 출력 2

1

예제 입력 3

4 3 1

예제 출력 3

3