Painter's Studio

No attempts yetTime limit1sMemory limit128 MB

Problem

The Painter's Studio is preparing to mass-produce paintings. The paintings are made with the help of square matrices of various sizes. A matrix of size ii has 2i2^i rows and 2i2^i columns, with holes at the intersections of some rows and columns. A matrix of size 00 is a single cell and has exactly one hole.

For i>0i > 0, a matrix of size ii is built from four squares of size 2i1×2i12^{i-1} \times 2^{i-1}. The top-left square has no holes, while the top-right, bottom-left, and bottom-right squares are each a matrix of size i1i-1.

A painting is made as follows. First we fix three non-negative integers nn, xx, and yy. We take two matrices of size nn, lay one on top of the other, and shift the upper one xx columns to the right and yy rows up. We place this pattern on a white canvas and paint the overlapping region yellow wherever a hole of the upper matrix meets a hole of the lower matrix. Each such coincidence leaves one yellow stain.

For example, take two matrices of size 22 and shift the upper one 22 columns right and 22 rows up.

In this case the holes coincide in exactly three places.

Write a program that reads the size of the two matrices and the shift amounts and prints the number of yellow stains.

Input

The first line contains one integer nn (0n1000 \le n \le 100), the size of the matrices. The second line contains one integer xx and the third line one integer yy (0x,y2n0 \le x, y \le 2^n). The upper matrix is shifted xx columns to the right and yy rows up.

Output

Print a single line with the number of yellow stains on the canvas.