#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long ab(long long x) {
  if (x < 0)
    return -x;
  else
    return x;
}
struct Fraction {
  long long x, y;
  Fraction() {
    x = 0;
    y = 1;
  }
  Fraction(long long X, long long Y) {
    if (Y < 0) {
      Y = -Y;
      X = -X;
    }
    long long g = gcd(ab(X), ab(Y));
    x = X / g;
    y = Y / g;
  }
} c[100111];
bool operator==(Fraction a, Fraction b) { return a.x * b.y == a.y * b.x; }
bool operator<(Fraction a, Fraction b) {
  if (a.x < 0 && b.x > 0) return true;
  if (a.x > 0 && b.x < 0) return false;
  return a.x * b.y < a.y * b.x;
}
Fraction operator*(long long x, Fraction a) { return Fraction(x * a.x, a.y); }
Fraction operator+(Fraction a, Fraction b) {
  long long lcm = a.y * b.y / gcd(a.y, b.y);
  a = (lcm / a.y) * a;
  b = (lcm / b.y) * b;
  return Fraction(a.x + b.x, lcm);
}
pair<long long, long long> a[100111];
vector<int> ls[100111];
int n;
int main() {
  while (scanf("%d", &n) == 1) {
    int s = 0;
    for (int i = 1; i <= n; ++i) {
      scanf("%I64d%I64d", &a[i].first, &a[i].second);
      if (a[i].first) c[++s] = Fraction(-a[i].second, a[i].first);
    }
    sort(c + 1, c + s + 1);
    s = unique(c + 1, c + s + 1) - c - 1;
    for (int i = 1; i <= s; ++i) ls[i].clear();
    for (int i = 1; i <= n; ++i)
      if (a[i].first) {
        int u =
            lower_bound(c + 1, c + s + 1, Fraction(-a[i].second, a[i].first)) -
            c;
        ls[u].push_back(i);
      }
    long long k = 0, b = 0, cnt = 0;
    for (int i = 1; i <= n; ++i)
      if (a[i].first <= 0) {
        k += a[i].first;
        b += a[i].second;
      }
    for (int i = 1; i <= s; ++i) {
      long long kk = k, bb = b;
      for (int x = 0; x < ls[i].size(); ++x) {
        int u = ls[i][x];
        if (a[u].first > 0) {
          kk += a[u].first;
          bb += a[u].second;
        } else if (a[u].first < 0) {
          kk -= a[u].first;
          bb -= a[u].second;
        }
      }
      if (kk != k || bb != b) {
        if (kk * c[i] + Fraction(bb, 1) == k * c[i] + Fraction(b, 1))
          cnt += 1;
        else
          cnt += 1;
      }
      k = kk;
      b = bb;
    }
    cout << cnt << endl;
  }
  return 0;
}
