#include <bits/stdc++.h>
using namespace std;
const int MaxN = 100005;
struct Node {
  long long a, b;
  Node() {}
  Node(long long a, long long b) : a(a), b(b) {}
  bool operator<(const Node& node) const {
    int fd = int(b < 0) + int(node.b < 0);
    fd &= 1;
    if (fd == 0)
      return a * node.b < b * node.a;
    else
      return a * node.b > b * node.a;
  }
  bool operator==(const Node& node) const { return a * node.b == b * node.a; }
};
pair<Node, pair<int, int> > p[MaxN];
int main() {
  int N, M;
  long long last;
  int ret;
  while (scanf("%d", &N) == 1) {
    ret = 0;
    last = 0;
    M = 0;
    for (int i = 0; i < N; i++) {
      int k, b;
      scanf("%d%d", &k, &b);
      if (k == 0)
        continue;
      else
        p[M++] = make_pair(Node(b, k), make_pair(k, k < 0 ? -1 : 1));
      if (k < 0) last += k;
    }
    N = M;
    sort(p, p + N);
    for (int i = 0, j = 0; i < N; i = j) {
      j = i;
      long long cur = last;
      while (j < N && p[i].first == p[j].first) {
        cur += p[j].second.first * p[j].second.second;
        j++;
      }
      ret += cur != last;
      last = cur;
    }
    printf("%d\n", ret);
  }
  return 0;
}
