#include <bits/stdc++.h>
using namespace std;
int gcd(int u, int v) {
  if (abs(v) > abs(u)) swap(u, v);
  return (v) ? gcd(v, u % v) : u;
}
int main() {
  set<pair<int, int> > s;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int k, b;
    scanf("%d%d", &k, &b);
    if (k == 0) continue;
    int x = gcd(k, b);
    k /= x;
    b /= x;
    s.insert(make_pair(k, b));
  }
  printf("%d\n", s.size());
  return 0;
}
