#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
int n;
int m;
vector<pair<pair<int, int>, pair<int, int> > > v;
vector<pair<long long, long long> > res;
bool l1(pair<pair<int, int>, pair<int, int> > a,
        pair<pair<int, int>, pair<int, int> > b) {
  return (long long)a.first.first * b.first.second <
         (long long)b.first.first * a.first.second;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int k, b;
    scanf("%d%d", &k, &b);
    if (k < 0) {
      v.push_back(make_pair(make_pair(-2e9, 1), make_pair(k, b)));
      v.push_back(make_pair(make_pair(b, -k), make_pair(-k, -b)));
    } else if (k > 0) {
      v.push_back(make_pair(make_pair(-b, k), make_pair(k, b)));
      v.push_back(make_pair(make_pair(2e9, 1), make_pair(-k, -b)));
    }
  }
  v.push_back(make_pair(make_pair(-2e9, 1), make_pair(0, 0)));
  v.push_back(make_pair(make_pair(2e9, 1), make_pair(0, 0)));
  sort((v).begin(), (v).end(), l1);
  long long sk = 0, sb = 0;
  for (int i = 0; i + 1 < ((int)(v).size()); i++) {
    sk += v[i].second.first;
    sb += v[i].second.second;
    if (l1(v[i], v[i + 1])) res.push_back(make_pair(sk, sb));
  }
  int ans = 0;
  for (int i = 0; i + 1 < ((int)(res).size()); i++)
    ans += int(res[i] != res[i + 1]);
  printf("%d\n", ans);
  return 0;
}
