#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > otr(100000);
bool operator<(const pair<int, int>& p, const pair<int, int>& q) {
  if (p.first == 0) return false;
  if (q.first == 0) return true;
  long long t = (long long)p.first * q.second - (long long)q.first * p.second;
  bool c = false;
  if ((long long)p.first * q.first < 0) c = true;
  bool d = (t < 0);
  return (d ^ c);
}
void qsort(int l, int r) {
  pair<int, int> m = otr[(l + r) / 2];
  int i = l, j = r;
  while (i <= j) {
    while (otr[i] < m) ++i;
    while (m < otr[j]) --j;
    if (i <= j) {
      swap(otr[i], otr[j]);
      ++i;
      --j;
    }
  }
  if (l < j) qsort(l, j);
  if (i < r) qsort(i, r);
}
bool operator==(const pair<int, int>& p, const pair<int, int>& q) {
  long long t = (long long)p.first * q.second - (long long)q.first * p.second;
  return (t == 0);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> otr[i].first >> otr[i].second;
  qsort(0, n - 1);
  int pos = 0, kol = 0;
  while (pos < n) {
    int pos1 = pos;
    long long sum = 0, sum1 = 0, sum2 = 0, sum3 = 0;
    while (pos < n && otr[pos] == otr[pos1]) {
      if (otr[pos].first > 0) {
        sum += (long long)otr[pos].first;
        sum1 += (long long)otr[pos].second;
      } else {
        sum2 += (long long)otr[pos].first;
        sum3 += (long long)otr[pos].second;
      }
      ++pos;
    }
    if (otr[pos1].first != 0 && (sum != sum2 || sum1 != sum3)) ++kol;
  }
  cout << kol;
  return 0;
}
