Lands of Antarctica#501

Lands of Antarctica

1 second
128 megabytes
Medium (≈1350)
prb1685.gif

Dots on the map of Antarctica shows the n polar stations, each of which has natural coordinates in a rectangular grid. The transition between the two stations is possible if the distance between them in a straight line less than two unit segments of the map. Stations, between which there exists a direct or indirect paths, are united into the land. Each station belongs to one land only.

You must find the number k of Arctic lands.

Input

The first line contains the number n of stations. Each of the next n lines contains two numbers - the coordinates of each station. All values are positive integers and do not exceed 100.

Output

Print the number of lands.

Examples

Example 1

Loading
Loading