#include <bits/stdc++.h>
using namespace std;
int ck[100100];
int cb[100100];
bool cmp(pair<pair<long long, long long>, pair<int, int> > a,
         pair<pair<long long, long long>, pair<int, int> > b) {
  long long c = b.first.second * a.first.first - a.first.second * b.first.first;
  long long d = a.first.second * b.first.second;
  return (((c < 0) && (d > 0)) || ((c > 0) && (d < 0)));
}
inline bool equal(pair<long long, long long> a, pair<long long, long long> b) {
  return ((b.second * a.first - a.second * b.first) == 0);
}
vector<pair<pair<long long, long long>, pair<int, int> > > a;
int main() {
  int res = 0;
  int n;
  cin >> n;
  long long k = 0, b = 0;
  for (int i = (0); i < (n); ++i) {
    int curk, curb;
    scanf("%d%d", &curk, &curb);
    if (curk == 0) continue;
    if (curk > 0)
      a.push_back(make_pair(make_pair(curb, curk), make_pair(i, 1)));
    else {
      a.push_back(make_pair(make_pair(curb, curk), make_pair(i, 0)));
      k += curk;
      b += curb;
    }
    ck[i] = curk;
    cb[i] = curb;
  }
  sort(a.begin(), a.end(), cmp);
  int i = 0;
  while (i < a.size()) {
    long long lk = k, lb = b;
    if (a[i].second.second == 1) {
      k += ck[a[i].second.first];
      b += cb[a[i].second.first];
    } else {
      k -= ck[a[i].second.first];
      b -= cb[a[i].second.first];
    }
    i++;
    while ((i < a.size()) && (equal(a[i].first, a[i - 1].first))) {
      if (a[i].second.second == 1) {
        k += ck[a[i].second.first];
        b += cb[a[i].second.first];
      } else {
        k -= ck[a[i].second.first];
        b -= cb[a[i].second.first];
      }
      i++;
    }
    if ((k != lk) || (b != lb)) res++;
  }
  cout << res << endl;
  return 0;
}
