#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#typedef long long ll
#define INF 2147483647
using namespace std;
using Graph=vector<vector<int>>;

ll gcd(ll a,ll b){
  a=abs(a); b=abs(b);
  if(a==0 || b==0){
    return abs(a+b);
  }
  if(a<b){
    ll tmp=a; a=b; b=tmp;
  }
  ll r=a%b;
  while(r!=0){
    a=b;
    b=r;
    r=a%b;
  }
  return b;
}

ll RepSq(ll a,ll n,ll mod){
  if(n==0){
    return 1;
  }else if(n%2!=0){
    return (a*RepSq(a,n-1,mod))%mod;
  }else{
    ll x=RepSq(a,n/2,mod);
    return (x*x)%mod;
  }
}

int main(){
  ll n;
  cin>>n;
  ll mod=1000000007
  ll a[n],b[n],g[n];
  map<pair<ll,ll>,ll> mp;
  rep(i,n){
    cin>>a[i]>>b[i];
    g[i]=gcd(a[i],b[i]);
    a[i]/=g[i]; b[i]/=g[i];
    if(a[i]<0 || (a[i]==0 && b[i]>0)){
      a[i]*=-1; b[i]*=-1;
    }
    mp[make_pair(a[i],b[i])]++;
  }
  ll ans=0;
  for(auto p:mp){
    ll x,y,z,w;
    x=p.first.first; y=p.first.second;
    z=p.second;
    if(y<0){
      w=mp[make_pair(-y,x)];
    }else{
      w=mp[make_pair(y,-x)];
    }
  }
}
