#include <bits/stdc++.h>
using namespace std;
int a[1000005];
int b[1000005];
int c[1000005];
int main()
{
int n;
int cnt=0;
cin>>n;
for (int i=1;i<=n;i++)
{
cin>>a[i];
cin>>b[i];
c[a[i]*b[i]]++;
}
for (int i=1;i<=1000000;i++)
{
if (c[i]>=2)
{
cnt+=c[i]*(c[i]-1)/2;
}
}
cout<<cnt;
return 0;
}
评论区