#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<long long, long long>& lhs,
         const pair<long long, long long>& rhs) {
  if (lhs.first * rhs.first > 0)
    return lhs.second * rhs.first < rhs.second * lhs.first;
  else
    return lhs.second * rhs.first > rhs.second * lhs.first;
}
bool isSame(const pair<long long, long long>& lhs,
            const pair<long long, long long>& rhs) {
  return lhs.second * rhs.first == rhs.second * lhs.first;
}
int main() {
  int N;
  cin >> N;
  vector<pair<long long, long long> > v;
  for (int i = 0; i < N; i++) {
    long long k, b;
    cin >> k >> b;
    if (k != 0) v.push_back(make_pair(k, b));
  }
  sort(v.begin(), v.end(), cmp);
  int idx = 0;
  int cnt = 0;
  while (idx < v.size()) {
    long long kc = v[idx].first, bc = v[idx].second;
    pair<long long, long long> tst = make_pair(kc, bc);
    long long kt = 0, bt = 0;
    while (idx < v.size() && isSame(tst, v[idx])) {
      if (v[idx].first < 0)
        kt -= v[idx].first, bt -= v[idx].second;
      else
        kt += v[idx].first, bt += v[idx].second;
      idx++;
    }
    if (kt != 0 || bt != 0) cnt += 1;
  }
  cout << cnt << endl;
  return 0;
}
