#include <bits/stdc++.h>
using namespace std;
int const MaxN=2000;
int N;
struct NODE{
int x,y;
NODE(int x=0,int y=0):x(x),y(y){}
};
NODE node[MaxN];
bool comp(NODE lhs,NODE rhs){
return (lhs.y!=rhs.y)? lhs.y<rhs.y:lhs.x<rhs.x;
}
int Cmath(int num,int k){
if(num<k){
return 0;
}
int ans=1;
for(int i=1;i<=num;i++){
ans*=i;
}
for(int o=1;o<=k;o++){
ans/=o;
}
for(int o=1;o<=(num-k);o++){
ans/=o;
}
return ans;
}
int main() {
int A,B;
cin>>N;
for(int n=0;n<N;n++){
cin>>A>>B;
node[n]=NODE(A,B);
}
sort(node,node+N,comp);
int same=0,ansnum=0;
for(int n=0;n<N;n++){
if(node[n].y==node[n+1].y){
for(int m=n+1;m<N;m++){
if(node[m].y==node[m+1].y){
if(node[n].x==node[m].x){
same++;
}
}else{
same++;
}
}
}
cout<<same<<"\n";
ansnum+=Cmath(same,2);
same=0;
}
/*for(int n=0;n<N;n++){
cout<<node[n].x<<" "<<node[n].y<<"\n";
}*/
cout<<ansnum;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgY29uc3QgTWF4Tj0yMDAwOwppbnQgTjsKc3RydWN0IE5PREV7CglpbnQgeCx5OwoJTk9ERShpbnQgeD0wLGludCB5PTApOngoeCkseSh5KXt9Cn07Ck5PREUgbm9kZVtNYXhOXTsKYm9vbCBjb21wKE5PREUgbGhzLE5PREUgcmhzKXsKCXJldHVybiAobGhzLnkhPXJocy55KT8gbGhzLnk8cmhzLnk6bGhzLng8cmhzLng7Cn0KCmludCBDbWF0aChpbnQgbnVtLGludCBrKXsKCWlmKG51bTxrKXsKCQlyZXR1cm4gMDsKCX0KCWludCBhbnM9MTsKCWZvcihpbnQgaT0xO2k8PW51bTtpKyspewoJCWFucyo9aTsKCX0KCWZvcihpbnQgbz0xO288PWs7bysrKXsKCQlhbnMvPW87Cgl9Cglmb3I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