Problems

# Lands of Antarctica

# Lands of Antarctica

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 natural and do not exceed **100**.

#### Output

Print the number of lands.

Input example #1

10 2 4 6 2 2 1 2 6 4 3 4 1 1 5 5 2 1 3 3 5

Output example #1

3