//Euzibillahiminesseytanirracim Bismillahirrahmanirrahim
/*
ID:
TASK:
LANG: C++
*/
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define PII pair<int,int>
#define inf 1000000001
using namespace std;
map<int,int> m , p;
int n, x[300001], y[300001], ans;
int main()
{
cin>>n;
for(int i=1;i<=n;i++){
cin>>x[i]>>y[i];
m[x[i]]++;
p[y[i]]++;
}
for(int i=1;i<=n;i++){
ans += (m[x[i]] - 1)*(p[y[i]] - 1);
}
cout<<ans<<"\n";
}
/*
_________oBBBBB8o oBBBBBBB8
_____o8BBBBBBBBBBB BBBBBBBBB8 o88o
___o8BBBBBB**8BBBB BBBBBBBBBB oBBBBBBBo
__oBBBBBBB* *** BBBBBBBBBB BBBBBBBBBBo
_8BBBBBBBBBBooooo *BBBBBBB8 *BB* 8BBBBBBo
_8BBBBBBBBBBBBBBBB8ooBBBBBBB8 8BBBBBBB8
__*BBBBBBBBBBBBBBBBBBBBBBBBBB8 o88BB88BBBBBBBBBBBB
____*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB8
______**8BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
___________*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB8*
____________*BBBBBBBBBBBBBBBBBBBBBBBB8888**
_____________BBBBBBBBBBBBBBBBBBBBBBB*
_____________*BBBBBBBBBBBBBBBBBBBBB*
______________*BBBBBBBBBBBBBBBBBB8
_______________*BBBBBBBBBBBBBBBB*
________________8BBBBBBBBBBBBBBB8
_________________8BBBBBBBBBBBBBBBo
__________________BBBBBBBBBBBBBBB8
__________________BBBBBBBBBBBBBBBB
__________________8BBBBBBBBBBBBBBB8
__________________*BBBBBBBBBBBBBBBB
__________________8BBBBBBBBBBBBBBBB8
_________________oBBBBBBBBBBBBBBBBBB
________________oBBBBBBBBBBBBBBBBBBB
________________BBBBBBBBBBBBBBBBBBBB
_______________8BBBBBBBBBBBBBBBBBBB8
______________oBBBBBBBBB88BBBBBBBBB8
______________8BBBBBBBBB*8BBBBBBBBB*
______________BBBBBBBBB* BBBBBBBBB8
______________BBBBBBBB8 oBBBBBBBBB*
______________8BBBBBBB oBBBBBBBB*
______________BBBBBBB* 8BBBBBBB*
_____________8BBBBBB* BBBBBBB*
____________8BBBBBB8 oBBBBBB8
___________8BBBBBB8 8BBBBBB*
__________oBBBBBB8 BBBBBBB8
__________BBBBBBB8 BBBBBBBB*
_________oBBBBBBB8 BBBBBBBB
_________8BBBBBB8 BBBBBBB*
_________BBBBBB* 8BBBBB*
________oBBBB8 BBBBB*
________oBBB8 BBBB*
________BBBB8 8BBBBo
_______8BBBB* oBBBBBBo
______8BBBB* *BBBBBBBB8o
______BBBBB* *88BBBo
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
380 KB |
Output is correct |
3 |
Correct |
2 ms |
456 KB |
Output is correct |
4 |
Correct |
3 ms |
500 KB |
Output is correct |
5 |
Correct |
2 ms |
644 KB |
Output is correct |
6 |
Correct |
3 ms |
644 KB |
Output is correct |
7 |
Correct |
2 ms |
644 KB |
Output is correct |
8 |
Correct |
2 ms |
644 KB |
Output is correct |
9 |
Correct |
3 ms |
644 KB |
Output is correct |
10 |
Correct |
3 ms |
644 KB |
Output is correct |
11 |
Correct |
3 ms |
660 KB |
Output is correct |
12 |
Correct |
17 ms |
1060 KB |
Output is correct |
13 |
Correct |
20 ms |
1060 KB |
Output is correct |
14 |
Correct |
23 ms |
1464 KB |
Output is correct |
15 |
Correct |
341 ms |
4320 KB |
Output is correct |
16 |
Correct |
329 ms |
4320 KB |
Output is correct |
17 |
Correct |
290 ms |
4368 KB |
Output is correct |
18 |
Correct |
327 ms |
4368 KB |
Output is correct |
19 |
Correct |
866 ms |
5900 KB |
Output is correct |
20 |
Correct |
609 ms |
6252 KB |
Output is correct |
21 |
Correct |
890 ms |
7084 KB |
Output is correct |
22 |
Correct |
913 ms |
7084 KB |
Output is correct |