Displacing Particles

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

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

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

입력

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

출력

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