#include <bits/stdc++.h>
using namespace std;
char str[110];
void in(long long &x, long long &y) {
  scanf("%s", str);
  int len = strlen(str);
  int at;
  for (int i = 0; i < len; i++)
    if (str[i] == '/') at = i;
  x = 0;
  for (int i = 0; i < at; i++) x = x * 10 + (str[i] - '0');
  y = 0;
  for (int i = at + 1; i < len; i++) y = y * 10 + (str[i] - '0');
}
struct Point {
  long long x, y;
  void in() { scanf("%I64d %I64d", &x, &y); }
} p[100010], q[100010];
bool cmp_y(Point a, Point b) { return a.y > b.y; }
struct Node {
  long long up, down;
  int id;
  bool operator==(Node a) { return up * a.down == down * a.up; }
} e[100010];
bool cmp(Node a, Node b) { return a.up * b.down < b.up * a.down; }
Point mark[100010];
int X[100010];
int Y[100010];
int totalx, totaly;
int max_value[100010 * 4];
void pushup(int rt) {
  max_value[rt] = max(max_value[rt << 1], max_value[rt << 1 | 1]);
}
void update(int pos, int s, int l, int r, int rt) {
  if (l == r) {
    max_value[rt] = max(max_value[rt], s);
    return;
  }
  int m = (l + r) / 2;
  if (pos <= m)
    update(pos, s, l, m, rt << 1);
  else
    update(pos, s, m + 1, r, rt << 1 | 1);
  pushup(rt);
}
int query(int L, int R, int l, int r, int rt) {
  if (R == 0) return 0;
  if (L <= l && r <= R) return max_value[rt];
  int m = (l + r) / 2;
  int tmp = 0;
  if (L <= m) tmp = max(tmp, query(L, R, l, m, rt << 1));
  if (R > m) tmp = max(tmp, query(L, R, m + 1, r, rt << 1 | 1));
  return tmp;
}
int pp[100010];
int qq;
int main() {
  int n;
  scanf("%d", &n);
  long long Ax, Ay, Bx, By;
  in(Ax, Ay);
  in(Bx, By);
  int m = 0;
  for (int i = 0; i < n; i++) {
    p[i].in();
    if (Ax * p[i].x >= Ay * p[i].y || Bx * p[i].x <= By * p[i].y) continue;
    q[m++] = p[i];
  }
  if (m == 0 || Ay == 0 || Bx == 0) {
    printf("0\n");
    return 0;
  }
  n = m;
  for (int i = 0; i < n; i++) p[i] = q[i];
  for (int i = 0; i < n; i++) {
    e[i].id = i;
    e[i].up = p[i].y * Ay - p[i].x * Ax;
    e[i].down = Ay;
  }
  sort(e, e + n, cmp);
  totalx = 0;
  X[e[0].id] = ++totalx;
  for (int i = 1; i < n; i++) {
    if (e[i] == e[i - 1])
      X[e[i].id] = X[e[i - 1].id];
    else
      X[e[i].id] = ++totalx;
  }
  for (int i = 0; i < n; i++) {
    e[i].id = i;
    e[i].up = p[i].y * By - p[i].x * Bx;
    e[i].down = By;
    if (By == 0) {
      e[i].up = -p[i].x;
      e[i].down = 1;
    }
  }
  sort(e, e + n, cmp);
  totaly = 0;
  Y[e[0].id] = ++totaly;
  for (int i = 1; i < n; i++) {
    if (e[i] == e[i - 1])
      Y[e[i].id] = Y[e[i - 1].id];
    else
      Y[e[i].id] = ++totaly;
  }
  for (int i = 0; i < n; i++) mark[i].x = X[i], mark[i].y = Y[i];
  sort(mark, mark + n, cmp_y);
  memset(max_value, 0, sizeof(max_value));
  int ans = 0;
  int j = 0;
  for (int i = 0; i < n; i = j) {
    for (j = i; j < n; j++)
      if (mark[i].y != mark[j].y) break;
    for (int k = i; k < j; k++) {
      int tmp = query(1, mark[k].x - 1, 1, n, 1) + 1;
      ans = max(ans, tmp);
      pp[k] = tmp;
    }
    for (int k = i; k < j; k++) update(mark[k].x, pp[k], 1, n, 1);
  }
  printf("%d\n", ans);
  return 0;
}
