#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (a) {
    b %= a;
    swap(a, b);
  }
  return b;
}
map<pair<int, int>, int> mp;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int k, b;
    scanf("%d %d", &k, &b);
    int A = -b;
    int B = k;
    if (k == 0) continue;
    if ((A < 0 && B > 0) || (A > 0 && B < 0)) {
      A = -abs(A);
      B = abs(B);
    } else {
      A = abs(A);
      B = abs(B);
    }
    int g = gcd(abs(A), abs(B));
    A /= g;
    B /= g;
    if (A == 0) B = abs(B);
    pair<int, int> cur = make_pair(A, B);
    mp[cur] = 1;
  }
  printf("%d", mp.size());
  return 0;
}
