Chords#448

Chords

1 second
122.174 megabytes
Hard

You are given a circle in which chords are drawn, dividing the circle into several regions. No two chords share an endpoint, and no three chords intersect at a single point.

Input

The first line contains an integer (1 \leq n \leq 30000) – the number of chords.

Each of the next lines contains two real numbers a_i and b_i (0 \leq a_i, b_i < 360), each specified to exactly three digits after the decimal point – the polar angles (in degrees) of the endpoints of the -th chord. The origin of the polar coordinate system is at the center of the circle.

Output

Print the number of regions into which the circle is divided after all the chords are drawn.

Examples

Example 1

Loading
Loading