12
-6712 6
2375 73
4643 197
-5660 215
-378 223
2228 307
3305 340
3449 468
-4389 707
-7161 729
-1838 921
-1655 985
730
 5
1 5
6 7
17127 17
17072 42
17042 77
3
 7
-976754 20479
79929143 911181
9598220 82517
-51609349 810257
67416551 266544
-14170975 307690
-15476178 491195
352
 22
-5301 602
-1400 194
-8512 987
-282 962
6484 494
9091 523
-7744 92
6002 461
5053 305
-1339 272
-821 165
9308 785
929 421
8384 883
1266 157
8411 923
-2949 885
7725 687
6859 197
-7630 867
5031 918
5662 410
41

11 12
 2 3
 5 5
 9 9

#include <bits/stdc++.h>
using namespace std;
long long bigmod(long long b, long long p) {
  if (p == 0) return 1;
  long long my = bigmod(b, p / 2);
  my *= my;
  my %= 1000000007;
  if (p & 1) my *= b, my %= 1000000007;
  return my;
}
int setb(int n, int pos) { return n = n | (1 << pos); }
int resb(int n, int pos) { return n = n & ~(1 << pos); }
bool checkb(int n, int pos) { return (bool)(n & (1 << pos)); }
long long n, v, ara[100005][2];
long long tree[4 * 100005], N;
long long ans[100005];
void U(long long ind, long long b, long long e, long long i, long long x) {
  if (b == e) {
    tree[ind] = max(tree[ind], x);
    return;
  }
  long long mid = (b + e) / 2, l = 2 * ind, r = l + 1;
  if (i <= mid)
    U(l, b, mid, i, x);
  else
    U(r, mid + 1, e, i, x);
  tree[ind] = max(tree[l], tree[r]);
}
long long Q(long long ind, long long b, long long e, long long i, long long j) {
  if (i > j) return 0;
  if (b == i && e == j) return tree[ind];
  long long mid = (b + e) / 2, l = 2 * ind, r = l + 1;
  return max(Q(l, b, mid, i, min(j, mid)),
             Q(r, mid + 1, e, max(mid + 1, i), j));
}
struct xsort {
  long long d, t, idx;
  xsort() {}
  xsort(long long dd, long long tt, long long i) {
    d = dd;
    t = tt;
    idx = i;
  }
  bool operator<(const xsort &p) const {
    long long dd = p.d - d;
    long long dt = p.t - t;
    if (-dd < dt)
      return true;
    else
      return false;
  }
};
vector<xsort> xv;
struct ysort {
  long long d, t, idx;
  ysort() {}
  ysort(long long dd, long long tt, long long i) {
    d = dd;
    t = tt;
    idx = i;
  }
  bool operator<(const ysort &p) const {
    long long dd = p.d - d;
    long long dt = p.t - t;
    if (dd < dt)
      return true;
    else
      return false;
  }
};
vector<ysort> yv;
struct info {
  long long d, t, xval, yval, id;
  bool operator<(const info &p) const {
    if (xval == p.xval)
      return yval < p.yval;
    else
      return xval < p.xval;
  }
};
info lol[100005];
bool issame_x(long long d1, long long t1, long long d2, long long t2) {
  long long dd = d2 - d1;
  long long dt = t2 - t1;
  if (-dd == dt)
    return 1;
  else
    return 0;
}
bool issame_y(long long d1, long long t1, long long d2, long long t2) {
  long long dd = d2 - d1;
  long long dt = t2 - t1;
  if (dd == dt)
    return 1;
  else
    return 0;
}
void prework() {
  long long cur;
  for (long long i = 1; i <= n; i++)
    lol[i].d = ara[i][0], lol[i].t = ara[i][1], lol[i].id = i;
  cur = 1;
  lol[xv[0].idx].xval = cur;
  for (long long i = 1; i < n; i++) {
    if (issame_x(xv[i - 1].d, xv[i - 1].t, xv[i].d, xv[i].t) == 0) cur++;
    lol[xv[i].idx].xval = cur;
  }
  cur = 1;
  lol[yv[0].idx].yval = cur;
  for (long long i = 1; i < n; i++) {
    if (issame_y(yv[i - 1].d, yv[i - 1].t, yv[i].d, yv[i].t) == 0) cur++;
    lol[yv[i].idx].yval = cur;
  }
  N = cur;
  sort(lol + 1, lol + n + 1);
}
bool oka(long long idx) {
  if (ara[idx][0] <= ara[idx][1])
    return 1;
  else
    return 0;
}
long long tourist, shahed;
void F() {
  for (long long i = n; i >= 1; i--) {
    long long myval = lol[i].yval;
    long long ret = Q(1, 1, N, myval, N);
    ans[i] = ret + 1;
    U(1, 1, N, myval, ans[i]);
  }
  for (long long i = n; i >= 1; i--) tourist = max(tourist, ans[i]);
  for (long long i = 1; i <= n; i++) {
    if (oka(i)) {
      shahed = max(shahed, ans[i]);
    }
  }
}
int main() {
  long long i;
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) scanf("%lld %lld", &ara[i][0], &ara[i][1]);
  scanf("%lld", &v);
  for (i = 1; i <= n; i++) ara[i][1] *= v;
  for (i = 1; i <= n; i++) {
    xv.push_back(xsort(ara[i][0], ara[i][1], i));
    yv.push_back(ysort(ara[i][0], ara[i][1], i));
  }
  sort(xv.begin(), xv.end());
  sort(yv.begin(), yv.end());
  prework();
  F();
  printf("%lld %lld\n", shahed, tourist);
  return 0;
}
