#include <bits/stdc++.h>
using namespace std;
long long n;
vector<pair<long long, long long> > lines;
pair<long long, long long> l[100000];
bool compare(const pair<long long, long long> &p1,
             const pair<long long, long long> &p2) {
  return p1.second * p2.first > p2.second * p1.first;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long k, b;
    cin >> k >> b;
    ;
    if (k == 0) continue;
    if (k < 0) k *= -1, b *= -1;
    lines.push_back(make_pair(k, b));
  }
  sort(lines.begin(), lines.end(), compare);
  if (lines.size() == 0) {
    cout << 0 << endl;
    return 0;
  }
  long long cnt = 1, indx = 1;
  l[0].first = lines[0].first;
  l[0].second = lines[0].second;
  for (long long i = 1; i < lines.size(); i++) {
    l[indx].first = l[indx - 1].first + lines[i].first;
    l[indx].second = l[indx - 1].second + lines[i].second;
    pair<long long, long long> p1 = lines[i], p2 = lines[i - 1];
    if (p1.second * p2.first == p2.second * p1.first) continue;
    if (l[indx] != l[indx - 1]) cnt++;
    indx++;
  }
  cout << cnt << endl;
  return 0;
}
