#include <bits/stdc++.h>
using namespace std;
const long long _ = 1e5 + 7;
struct node {
  long long B, C;
} c[_];
long long N, A, B, C, D, dp[_];
long long arr[_];
void add(long long x, long long v) {
  while (x <= N) {
    arr[x] = max(arr[x], v);
    x += x & -x;
  }
}
long long qry(long long x) {
  long long sum = 0;
  while (x) {
    sum = max(sum, arr[x]);
    x -= x & -x;
  }
  return sum;
}
void clr(long long x) {
  while (x <= N) {
    arr[x] = 0;
    x += x & -x;
  }
}
signed main() {
  scanf("%lld", &N);
  scanf("%lld/%lld %lld/%lld", &A, &B, &C, &D);
  vector<long long> lc;
  for (long long i = 1, x, y; i <= N; ++i) {
    scanf("%lld %lld", &x, &y);
    long long q = y * B - x * A, r = y * D - x * C;
    c[i] = (node){q, r};
    lc.push_back(r);
  }
  ++N;
  lc.push_back(0);
  sort(lc.begin(), lc.end());
  lc.resize(unique(lc.begin(), lc.end()) - lc.begin());
  for (long long i = 1; i <= N; ++i)
    c[i].C = lower_bound(lc.begin(), lc.end(), c[i].C) - lc.begin() + 1;
  sort(c + 1, c + N + 1,
       [&](node p, node q) { return p.B < q.B || (p.B == q.B && p.C < q.C); });
  for (long long i = N; i; --i) {
    add(c[i].C, dp[i] = qry(c[i].C - 1) + 1);
    if (!c[i].B && !lc[c[i].C - 1]) {
      cout << dp[i] - 1;
      return 0;
    }
  }
}
