#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
const int inf = 0x7FFFFFFF;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
void show(T a, int n) {
  for (int i = 0; i < n; ++i) cout << a[i] << ' ';
  cout << endl;
}
template <class T>
void show(T a, int r, int l) {
  for (int i = 0; i < r; ++i) show(a[i], l);
  cout << endl;
}
struct S {
  long long k, b;
  const bool operator<(const S &y) const {
    if (y.k * k > 0)
      return b * y.k > y.b * k;
    else
      return b * y.k < y.b * k;
  }
  const bool operator==(const S &y) const { return b * y.k == k * y.b; }
  const bool operator>(const S &y) const { return b * y.k < k * y.b; }
} s[100005];
long long x[100005];
long long y[100005];
int id[100005];
int main() {
  int n;
  while (cin >> n) {
    int cnt = 0;
    long long tk, tb;
    for (int i = 0; i < n; i++) {
      cin >> tk >> tb;
      if (tk != 0) {
        s[cnt].k = tk;
        s[cnt].b = tb;
        cnt++;
      }
    }
    sort(s, s + cnt);
    memset(x, 0, sizeof(x));
    long long xl = 0;
    int qj = 1;
    for (int i = 0; i < cnt; i++) {
      id[i] = qj;
      if (s[i].k > 0)
        x[qj] += s[i].k;
      else
        y[qj - 1] += s[i].k;
      if (i < n - 1 && !(s[i + 1] == s[i])) qj++;
    }
    int ans = 0;
    for (int i = 1; i <= qj; i++) x[i] += x[i - 1];
    for (int i = qj - 1; i >= 0; i--) y[i] += y[i + 1];
    for (int i = 0; i <= qj; i++) x[i] += y[i];
    for (int i = 1; i <= qj; i++)
      if (x[i] != x[i - 1]) ans++;
    cout << ans << endl;
  }
  return 0;
}
