Lands of Antarctica#1685

Lands of Antarctica

1 second
128 megabytes
Medium

On the map of Antarctica, polar stations are shown as dots, each with integer coordinates on a rectangular grid. A transition between two stations is possible if their distance in a straight line is less than two unit segments on the map. Stations that are directly or indirectly connected are united into a land. Each station belongs to only one land.

Determine the number of arctic lands.

Input

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

Output

Print the number of lands.

Examples

Example 1

Loading
Loading