#include <bits/stdc++.h>
using namespace std;
long long x, y, l, i, j, n, k, k1, k2, k3, m, fldgjdflgjhrthrl,
    fldggfhfghjdflgjl, fldgjdflgrtyrtyjl, ffgfldgjdflgjl, r, z, max1, tx, pnt,
    flag;
long long b[200500], t[400500], to_push[400500];
string s;
vector<pair<long long, long long> > f;
vector<pair<long long, long long> > g;
bool cmp(pair<long long, long long> x, pair<long long, long long> y) {
  return (double)x.first / x.second < (double)y.first / y.second;
}
int main() {
  cin >> n;
  f.push_back(make_pair(((long long)1e+9) * 2, 1));
  f.push_back(make_pair(-((long long)1e+9) * 2, 1));
  for (i = 0; i < n; i++) {
    long long k, b;
    scanf("%I64d%I64d", &k, &b);
    if (k != 0) {
      f.push_back(make_pair(-b, k));
      g.push_back(make_pair(k, b));
    }
  }
  sort(f.begin(), f.end(), cmp);
  double angle = 0;
  long long sz = g.size();
  for (i = 0; i < sz; i++) {
    j = upper_bound(f.begin(), f.end(), make_pair(-g[i].second, g[i].first),
                    cmp) -
        f.begin() - 1;
    k = g[i].first;
    if (k > 0) {
      b[j] += k;
      b[f.size() - 1] -= k;
    } else {
      b[0] += k;
      b[j] -= k;
    }
  }
  long long ans = g.size();
  for (i = 1; i < f.size() - 1; i++)
    if (b[i] == 0) ans--;
  cout << ans << endl;
  return 0;
}
