#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
int main() {
  int n, b, k;
  cin >> n;
  set<pair<int, int> > s;
  for (int i = 0; i < n; i++) {
    cin >> k >> b;
    int g = gcd(b, k);
    if (k) s.insert(b ? make_pair(b / g, k / g) : make_pair(0, 0));
  }
  cout << s.size() << endl;
}
