1713 - Breaking News

Time Limit : 1 Second

Memory Limit : 512 MB

Submission: 17

Solved: 1

Description

ZBH lives in a city where breaking news happens every day.She likes breaking news and will be excited if she finds that breaking news are happening in her north,south,east and west.


That is to say , we can see ZBH’s city as a rectangular coordinates.Breaking news will only happens at integer points.The integer points which make ZBH excited will match the rule1 ,rule2 ,rule3 at the same time or only match rule4(suppose the cordinates of the integer point is (x,y)):


1.There are at least two breaking news happening in (x,y1),(x,y2),y1<y<y2.


2.There are at least two breaking news happening in (x1,y),(x2,y) x1<x<x2.


3.There are no breaking news happening in (x,y).


4.There are breaking news happening in (x,y).


You need to calculate the number of points which makes ZBH excited.

Input

The first line of the input file contains one integer number n (0 ≤ n ≤ 100 000) — number of breaking new which are happening.


The following n lines contain two integer numbers each — the coordinates of different breaking news. The coordinates do not exceed 10^9 .


 

Output

Output the number of points which make ZBH excited.


 

sample input
4
0 2
2 0
-2 0
0 -2
sample output
5
hint
source
dingyuyang
© 2015 HUST ACMICPC TEAM. All Right Reserved.