#include <bits/stdc++.h>
using namespace std;
inline bool eq(pair<int, int> a, pair<int, int> b) { return a == b; }
int gcd(int a, int b) {
  a = abs(a);
  b = abs(b);
  if (a < b) swap(a, b);
  while (b) {
    a %= b;
    if (a == 0) return b;
    b %= a;
  }
  return a;
}
int main() {
  int n, k, b;
  vector<pair<pair<int, int>, int> > a;
  scanf("%d", &n);
  for (int(i) = 0; (i) < (n); ++(i)) {
    scanf("%d%d", &k, &b);
    if (k == 0) continue;
    int g = gcd(b, k);
    pair<int, int> p;
    if (b == 0) {
      p = make_pair((0), (1));
    } else if (b < 0 && k < 0) {
      p = make_pair((abs(b / g)), (abs(k / g)));
    } else if ((b < 0 && k > 0) || (b > 0 && k < 0)) {
      p = make_pair((-abs(b / g)), (abs(k / g)));
    } else {
      p = make_pair((b / g), (k / g));
    }
    a.push_back(make_pair((p), (k)));
  }
  sort(a.begin(), a.end());
  int ans = 0, j;
  long long sum;
  for (int i = 0; i < a.size(); i = j) {
    j = i;
    sum = 0;
    while (j < a.size() && eq(a[i].first, a[j].first)) sum += a[j++].second;
    ++ans;
  }
  printf("%d\n", ans);
  return 0;
}
