#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int MAX = 2e6 + 5;
const long long MAX2 = 11;
const long long MOD = 1000000007;
const long long MOD2 = 1000005329;
const long long INF = 2e18;
const int dr[] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
const int dc[] = {0, 1, 0, -1, 1, -1, 1, -1, 0};
const double pi = acos(-1);
const long double EPS = 1e-15;
const int block = 2000;
long long n, k[MAX], b[MAX], ls, sum, ans;
vector<pair<pair<long long, long long>, int>> d;
bool cmp(pair<pair<long long, long long>, int> a,
         pair<pair<long long, long long>, int> b) {
  if (a.first.second < 0)
    a.first.first = -a.first.first, a.first.second = -a.first.second;
  if (b.first.second < 0)
    b.first.first = -b.first.first, b.first.second = -b.first.second;
  return a.first.first * b.first.second < b.first.first * a.first.second;
}
bool cek(pair<pair<long long, long long>, int> a,
         pair<pair<long long, long long>, int> b) {
  if (a.first.second < 0)
    a.first.first = -a.first.first, a.first.second = -a.first.second;
  if (b.first.second < 0)
    b.first.first = -b.first.first, b.first.second = -b.first.second;
  return a.first.first * b.first.second == b.first.first * a.first.second;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> k[i] >> b[i];
    if (!k[i]) continue;
    d.push_back({{-b[i], k[i]}, i});
  }
  d.push_back({{-2e9, 1}, 0});
  sort(d.begin(), d.end(), cmp);
  for (int i = 1; i <= n; ++i)
    if (k[i] < 0) sum += k[i];
  ls = sum;
  n = d.size() - 1;
  for (int i = 1; i <= n; ++i) {
    sum += abs(k[d[i].second]);
    while (i < n && cek(d[i], d[i + 1])) ++i, sum += abs(k[d[i].second]);
    if (sum != ls) ++ans;
    ls = sum;
  }
  cout << ans << '\n';
  return 0;
}
