Segments

No attempts yetTime limit1sMemory limit128 MB

Problem

Consider a set SS of nn vertical segments in the plane (each segment includes its two endpoints). No two segments of SS have a point in common.

Two segments see each other if there is a horizontal segment that joins them and has no point in common with any other segment of SS.

The figure below shows an example set of segments. The pairs of segments that see each other are 1-2, 1-3, 2-3, 1-5, and 4-5. Segments 1 and 4 do not see each other.

Among all sets of exactly nn pairwise disjoint vertical segments, we look for the largest possible number of pairs of segments that see each other. Given nn, compute this maximum number of visible pairs.

Input

The only line of input contains one integer nn (1n200001 \le n \le 20\,000).

Output

Print one integer: the maximum possible number of pairs of segments that can see each other, taken over all sets of nn pairwise disjoint vertical segments.

Hint