#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {
  set<pair<long long, long long> > s;
  long long n;
  cin >> n;
  while (n--) {
    long long a, b;
    cin >> a >> b;
    long long g = gcd(a, b);
    if (a == 0) continue;
    s.insert(make_pair(a / g, b / g));
  }
  cout << s.size() << "\n";
}
signed main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
