#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a < 0) a = -a;
  if (b < 0) b = -b;
  if (b == 0) return a;
  return gcd(b, a % b);
}
class Fraction {
 public:
  long long num, den;
  Fraction(long long x, long long y) {
    long long g = gcd(x, y);
    num = x / g;
    den = y / g;
    if (den < 0) {
      num = -num;
      den = -den;
    }
  }
  bool operator<(const Fraction& b) const {
    return (num * b.den - den * b.num) < 0;
  }
};
int main() {
  set<Fraction> S;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long k, b;
    cin >> k >> b;
    if (k == 0) continue;
    Fraction f(b, k);
    S.insert(f);
  }
  cout << S.size() << endl;
}
