Catarina loves all cats that live in her neighborhood. Her lifelong dream is to design a large cat-seeing circuit, so that every day she can go out and greet the cats while doing some exercise.
Catarina's neighborhood can be represented as the 2D plane, with the North-South direction aligned with the $$$y$$$-axis. A cat-seeing circuit that visits $$$m$$$ cats consists of exactly $$$m$$$ steps. Catarina chooses a starting position $$$(x_0, y_0)$$$ and faces one of the four cardinal directions. For each step $$${i}={1}, {2}, \ldots, {m}$$$ the following occurs:
Catarina knows the location of the $$$N$$$ cats that live in her neighborhood. Surprisingly, no two cats have the same $$$x$$$-coordinate or the same $$$y$$$-coordinate. Your task is to determine the maximum length that a cat-seeing circuit can have.
The first line contains an integer $$$N$$$ ($$$1 \leq N \leq 4000$$$) indicating the number of cats.
Each of the next $$$N$$$ lines describes a cat with two integers $$$X$$$ and $$$Y$$$ ($$$-10^{8} \leq X, Y \leq 10^{8}$$$), representing that the cat has coordinates $$$(X,Y)$$$.
No two cats have the same $$$x$$$-coordinate or $$$y$$$-coordinate (they differ in both of them).
Output a single line with an integer indicating the maximum length that a cat-seeing circuit can have.
51 22 10 0-1 -2-2 -1
0
64 00 42 -1-1 2-4 33 -4
32
72 10 -15 53 04 46 21 -2
24
Explanation for example 1
In this case there is a circuit of length $$$16$$$ that visits all the cats, but it is not a cat-seeing circuit because the cat at coordinates $$$(0,0)$$$ is greeted twice.
Explanation for example 2
The picture below shows the location of the cats with small circles, together with a maximum-length cat-seeing circuit that visits all of them. The length of the circuit is $$$32$$$.

Explanation for example 3
It is possible to visit $$$m=6$$$ of the $$$N=7$$$ cats with a cat-seeing circuit of length $$$24$$$.

| Name |
|---|


