#include <bits/stdc++.h>
using namespace std;
int cnt;
vector<pair<double, pair<int, int> > > w;
int euclid(int a, int b) {
  a = abs(a);
  b = abs(b);
  while (a > 0 && b > 0) {
    if (a >= b)
      a = a % b;
    else
      b = b % a;
  }
  return max(a, b);
}
int main(void) {
  cin >> cnt;
  int a, b, c;
  for (int i = 0; i < cnt; i++) {
    cin >> a >> b;
    if (a != 0) {
      c = euclid(a, b);
      w.push_back(make_pair((double)b / a * (-1.0), make_pair(b / c, a / c)));
    }
  }
  int n = 0;
  sort(w.begin(), w.end());
  for (int i = 0; i + 1 < w.size(); i++) {
    if ((w[i].second.first == w[i + 1].second.first &&
         w[i].second.second == w[i + 1].second.second) ||
        (w[i].second.first == w[i + 1].second.first * -1 &&
         w[i].second.second == w[i + 1].second.second * -1))
      n++;
  }
  cout << w.size() - n << endl;
  return 0;
}
