
Petryk and Vasylko are preparing for a test on Perimeter and Area of Figures. Petryk draws a geometric figure by coloring some cells of a grid blue. Vasylko calculates the perimeter of the resulting figure and tries to add as many red squares as possible so that the perimeter of the new figure remains unchanged.
Given the coordinates of all blue squares, write a program to determine the maximum number of additional red squares that can be added so that the perimeter of the figure remains unchanged.
The first line contains the number of blue squares (0 < n < 40404). Each of the next lines contains two integers , (-101 \le x, y \le 101) — the coordinates of the lower-left corner of a blue square.
Each blue square shares at least one common point (side or vertex) with another blue square. The figure formed by the blue squares is connected.
Print the maximum number of red squares that can be added to the figure without changing its perimeter.
Example 1