#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
int N;
ll gcd(ll a, ll b) { return (b ? gcd(b, a % b) : a); }
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> N;
  vector<ll> k(N), b(N);
  set<pair<ll, ll>> st;
  for (int i = 0; i < N; i++) {
    cin >> k[i] >> b[i];
    if (k[i] == 0) continue;
    ll g = gcd(abs(k[i]), abs(b[i])), sgn = (-1 * k[i] * b[i] > 0 ? 1 : -1);
    st.insert({sgn * abs(b[i]) / g, abs(k[i]) / g});
  }
  cout << st.size() << "\n";
}
