#include <bits/stdc++.h>
using namespace std;
struct fact {
  int a, b;
  fact(int _a = 0, int _b = 0) : a(_a), b(_b) {}
  bool operator<(const fact& rh) const {
    return -b / (double)a < -rh.b / (double)rh.a;
  }
} k[200000];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int t = 0;
    long long g = 0;
    for (int i = 0; i < n; ++i) {
      int a, b;
      scanf("%d%d", &a, &b);
      if (a) k[t++] = fact(a, b);
      if (a < 0) g += a;
    }
    sort(k, k + t);
    int ans = 0;
    for (int i = 0; i < t;) {
      int j;
      long long gg = g;
      for (j = i; j < t; ++j) {
        if (k[i] < k[j]) break;
        if (k[j].a < 0)
          g -= k[j].a;
        else
          g += k[j].a;
      }
      if (gg != g) ++ans;
      i = j;
    }
    printf("%d\n", ans);
  }
  return 0;
}
