cho.sh
Notes
Loading...

Maximum Number of Squares

Time limit

2s

Memory limit

128 MB

Problem

Place N distinct points on a two-dimensional plane. A square is counted when its four vertices are among the chosen points and every side is parallel to one of the coordinate axes.

The same square is counted only once; squares with different positions or side lengths are distinct.

Given N, find the maximum possible number of such squares.

Input

The first line contains an integer N. It satisfies 0 <= N <= 1,000,000.

Output

Print the maximum possible number of squares on the first line.