#include <bits/stdc++.h>
using namespace std;
int n;
long long gcd(long long x, long long y) { return (y == 0 ? x : gcd(y, x % y)); }
int main() {
  scanf("%d", &n);
  vector<tuple<long long, long long, long long> > ev;
  long long a = 0;
  for (int i = 0; i < n; i++) {
    int k, b;
    scanf("%d%d", &k, &b);
    if (k < 0) {
      a += k;
      long long g = gcd(abs(b), abs(k));
      ev.push_back(
          tuple<long long, long long, long long>(-1 * -b / g, -k / g, -k));
    } else if (k > 0) {
      long long g = gcd(abs(b), abs(k));
      ev.push_back(tuple<long long, long long, long long>(-b / g, k / g, k));
    }
  }
  sort(ev.begin(), ev.end(),
       [](const tuple<long long, long long, long long> &t1,
          const tuple<long long, long long, long long> &t2) {
         long long n1, d1, n2, d2;
         tie(n1, d1, ignore) = t1;
         tie(n2, d2, ignore) = t2;
         long long s = (d1 * d2 > 0 ? 1 : -1);
         return s * (n1 * d2 - n2 * d1) < 0;
       });
  int r = 0;
  long long prv = a;
  int p = 0;
  while (p < (int)ev.size()) {
    tuple<long long, long long, long long> t = ev[p];
    long long n1, d1;
    tie(n1, d1, ignore) = t;
    int q = p;
    while (q < (int)ev.size()) {
      long long n2, d2, k;
      tuple<long long, long long, long long> u = ev[q];
      tie(n2, d2, k) = u;
      if (!(n1 == n2 && d1 == d2)) break;
      a += k;
      q++;
    }
    if (prv != a) r++;
    prv = a;
    p = q;
  }
  cout << r << endl;
}
