#include <bits/stdc++.h>
using namespace std;
struct fin {
  vector<int> T;
  fin(int N) { T.resize(N + 47, -N); }
  int lastone(int x) { return x & (x ^ (x - 1)); }
  void put(int pos, int val) {
    for (int i = pos + 1; i < (int)T.size(); i += lastone(i))
      T[i] = max(T[i], val);
  }
  int get(int pos) {
    int ret = 0;
    for (int i = pos + 1; i > 0; i -= lastone(i)) ret = max(ret, T[i]);
    return ret;
  }
};
int main() {
  int N;
  scanf(" %d", &N);
  long long a, b, c, d;
  scanf(" %I64d/%I64d %I64d/%I64d", &b, &a, &d, &c);
  long long a2 = b, b2 = -a, c2 = d, d2 = -c;
  vector<pair<long double, long double> > V(N);
  map<long double, int> Mx, My;
  Mx[0] = My[0] = 0;
  for (int i = 0; i < N; i++) {
    long long x, y;
    scanf(" %I64d %I64d", &x, &y);
    long long z = a * c2 + b * d2;
    if (z == 0)
      V[i].first = x;
    else {
      long long w = x * c2 + y * d2;
      V[i].first = 1.0 * w / z;
    }
    z = c * a2 + d * b2;
    if (z == 0)
      V[i].second = y;
    else {
      long long w = x * a2 + y * b2;
      V[i].second = 1.0 * w / z;
    }
    Mx[V[i].first] = 0;
    My[V[i].second] = 0;
  }
  int mx = 0, my = 0;
  for (auto it = Mx.begin(); it != Mx.end(); it++) {
    if (it == Mx.begin())
      it->second = mx++;
    else {
      auto jt = it;
      jt--;
      if (((it->first - jt->first < 0) ? -(it->first - jt->first)
                                       : it->first - jt->first) < 1e-8)
        it->second = mx;
      else
        it->second = mx++;
    }
  }
  for (auto it = My.begin(); it != My.end(); it++) {
    if (it == My.begin())
      it->second = my++;
    else {
      auto jt = it;
      jt--;
      if (((it->first - jt->first < 0) ? -(it->first - jt->first)
                                       : it->first - jt->first) < 1e-8)
        it->second = my;
      else
        it->second = my++;
    }
  }
  vector<pair<int, int> > Vi;
  for (int i = 0; i < N; i++) {
    pair<int, int> p;
    auto it = Mx.lower_bound(V[i].first - 1e-8);
    p.first = it->second;
    it = My.lower_bound(V[i].second - 1e-8);
    p.second = it->second;
    if (p.second > My[0] && p.first > Mx[0]) Vi.push_back(p);
  }
  sort(begin(Vi), end(Vi));
  N = Vi.size();
  fin F(my);
  int j = 0, ansF = 0;
  vector<int> ans(N, 0);
  F.put(My[0], 0);
  for (int i = 0; i < N; i++) {
    while (Vi[j].first < Vi[i].first) {
      F.put(Vi[j].second, ans[j]);
      j++;
    }
    ans[i] = F.get(Vi[i].second - 1) + 1;
    ansF = max(ansF, ans[i]);
  }
  cout << ansF << "\n";
  return 0;
}
