#include <bits/stdc++.h>
using namespace std;
map<long double, pair<long long, long long> > m;
long long n, k, b, q, r, out;
int main() {
  scanf("%lld", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &k), scanf("%lld", &b);
    if (k < 0)
      m[-1.0 * b / k].first -= k, m[-1.0 * b / k].second -= b;
    else if (k > 0)
      m[-1.0 * b / k].first += k, m[-1.0 * b / k].second += b;
  }
  for (map<long double, pair<long long, long long> >::iterator it = m.begin();
       it != m.end(); ++it) {
    if (it->second.second || it->second.first) ++out;
  }
  cout << out;
}
