#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (b) {
    int t = a % b;
    a = b;
    b = t;
  }
  return a;
}
struct comp {
  bool operator()(const pair<int, int> &a, const pair<int, int> &b) {
    return (a.first == b.first) ? (a.second < b.second) : (a.first < b.first);
  }
};
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > a;
  a.reserve(n);
  for (int i = 0; i < n; ++i) {
    int k, b;
    cin >> k >> b;
    if (k != 0) {
      if (b == 0) {
        a.push_back(make_pair(0, 0));
      } else {
        int d = gcd(k, b);
        k /= d;
        b /= d;
        a.push_back(make_pair(b, k));
      }
    }
  }
  sort(a.begin(), a.end(), comp());
  a.erase(unique(a.begin(), a.end()), a.end());
  cout << a.size();
  return 0;
}
