The great farmer has decided to build a fence around his farm. The farm is a group of unit squares on a grid joined edge to edge, and it has no holes inside. The farmer wants to know how long the fence must be to surround the whole farm.
Given the positions of all the unit squares, compute the perimeter of the farm. For example, a farm built from 3 unit squares in an L shape has perimeter 8.
The input holds several test cases. Each test case starts with a line containing one integer N (1≤N≤1000), the area of the farm. Each of the next N lines contains two space separated integers x and y (0≤x,y≤100), the coordinates of the lower left corner of one unit square of the farm. The input ends with a line containing a single 0, and that line must not be processed.
For each test case, print one integer, the perimeter of the farm. Write the result of the ith test case on the ith line of the output.