Red John Game

No attempts yetTime limit2sMemory limit128 MB

Problem

Red John has a chessboard of infinite size and n2n^2 pawns, arranged on the board in an n×nn \times n square.

A pawn moves by jumping over a horizontally or vertically adjacent pawn and landing on the cell right behind it. The move is allowed only when that landing cell is empty, and the pawn that was jumped over is taken off the board.

Decide whether some sequence of these moves leaves exactly one pawn on the board.

For n=2n = 2, three moves leave one pawn. In the diagram below, P is a pawn and a dot is an empty cell.

P P .     . . P     . . P     . . .
P P .  -> P P .  -> . . P  -> . . .
. . .     . . .     . . .     . . P

Input

The first line contains the integer nn. (0<n<1090 < n < 10^9)

Output

Print 1 if the pawns can be reduced to a single pawn, and 0 if they cannot.