#include <bits/stdc++.h>
using namespace std;
long long K[100010];
long long B[100010];
bool valid(int i) { return (K[i] != 0); }
long long gcd(long long a, long long b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
set<pair<int, int> > points;
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < (N); i++) cin >> K[i] >> B[i];
  for (int i = 0; i < (N); i++)
    if (valid(i)) {
      long long g = gcd(B[i], K[i]);
      long long b = B[i] / g;
      long long k = K[i] / g;
      if (k < 0) {
        b *= -1;
        k *= -1;
      }
      points.insert(make_pair(-b, k));
    }
  cout << points.size() << endl;
}
