#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; }
pair<int, int> a[2100000];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
    if (a[i].first == 0) a[i].second = 1;
    if (a[i].second == 0) a[i].first = 1;
    if (a[i].first && a[i].second) {
      int g = gcd(a[i].first, a[i].second);
      a[i].first /= g;
      a[i].second /= g;
    }
    if (a[i].first < 0) {
      a[i].first *= -1;
      a[i].second *= -1;
    }
  }
  sort(a, a + n);
  int cnt = 0;
  for (int i = 0; i < n; i++)
    if (i == 0 || a[i] != a[i - 1]) {
      if (a[i].first != 0) cnt++;
    }
  cout << cnt;
  return 0;
}
