#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 1e5 + 10;
int gcd(int n, int m) { return m == 0 ? n : gcd(m, n % m); }
map<pair<int, int>, int> mc;
void add(int a, int b) {
  if (a < 0) a = -a, b = -b;
  if (a == 0) b = 1;
  int g = gcd(abs(a), abs(b));
  a /= g;
  b /= g;
  mc[{a, b}] = 1;
}
int main() {
  int n;
  cin >> n;
  while (n--) {
    int k, b;
    cin >> k >> b;
    if (k == 0) continue;
    add(-b, k);
  }
  cout << mc.size() << endl;
  return 0;
}
