#Lutece1293. stars

stars

Migrated from Lutece 1293 stars

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

给出平面上nn个不同的点,求有多少个平行于坐标轴的矩形

Input

第一行一个整数n(1n105)n(1\le n \le10^5),表示点的数量
接下来nn行,每行有两个整数,表示点的坐标xi,yi(109xi,yi109)x_i,y_i(-10^9\le x_i,y_i\le 10^9)

Output

输出一个整数ans,表示平行于坐标轴的矩形的数量

Samples

6
0 0
0 1
1 1
1 0
0 2
1 2
16
1 1
1 2
1 3
2 2
2 3
3 1
3 3
3 4
4 -1
4 1
4 2
4 3
4 4
5 1
5 2
5 4
3
14