#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int kk[N], bb[N], ii[N];
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  while (n--) {
    int k, b;
    cin >> k >> b;
    if (k == 0) continue;
    int d = gcd(k, b);
    k /= d, b /= d;
    kk[cnt] = k, bb[cnt] = b, ii[cnt] = cnt, cnt++;
  }
  if (cnt == 0) {
    cout << "0\n";
    return 0;
  }
  n = cnt;
  sort(ii, ii + n, [](int i, int j) {
    return kk[i] < kk[j] || kk[i] == kk[j] && bb[i] < bb[j];
  });
  for (int i = 1; i < n; i++)
    if (kk[ii[i - 1]] == kk[ii[i]] && bb[ii[i - 1]] == bb[ii[i]]) cnt--;
  cout << cnt << '\n';
  return 0;
}
