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>
#pragma GCC optimize(3)
using namespace std;
int V;
struct position {
  int x, t;
  bool operator<(position other) const { return t < other.t; }
};
int tree[262192];
position pos[262192];
int tmp[262192];
vector<int> disc;
int n;
int query(int start, int end, int l, int r, int index) {
  if (start > end || l > r) return -524292;
  if (start <= l && r <= end) return tree[index];
  int mid = (l + r) >> 1;
  if (end <= mid) return query(start, end, l, mid, index << 1);
  if (start >= mid + 1) return query(start, end, mid + 1, r, index << 1 | 1);
  return max(query(start, end, l, mid, index << 1),
             query(start, end, mid + 1, r, index << 1 | 1));
}
void update(int pos, int l, int r, int index, int val) {
  if (pos < l || pos > r || l > r) return;
  if (l == r && pos == r) {
    tree[index] = max(val, tree[index]);
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid) {
    update(pos, l, mid, index << 1, val);
  } else {
    update(pos, mid + 1, r, index << 1 | 1, val);
  }
  tree[index] = max(tree[index << 1], tree[index << 1 | 1]);
}
int solve(int tp) {
  int i, ans = 0, sz = (int)disc.size();
  if (tp == 1) {
    for (i = 0; i < 262192; ++i) tree[i] = -524292;
    int idx = lower_bound(disc.begin(), disc.end(), 0) - disc.begin();
    update(idx, 0, sz - 1, 1, 0);
  } else {
    for (i = 0; i < 262192; ++i) tree[i] = 0;
  }
  for (i = 1; i <= n; ++i) {
    int idx = lower_bound(disc.begin(), disc.end(), pos[i].x - pos[i].t * V) -
              disc.begin();
    int v = query(idx, sz - 1, 0, sz - 1, 1);
    update(idx, 0, sz - 1, 1, v + 1);
    ans = max(v + 1, ans);
  }
  return ans;
}
int main() {
  int i;
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) {
    scanf("%d%d", &pos[i].x, &pos[i].t);
  }
  scanf("%d", &V);
  for (i = 1; i <= n; ++i) {
    tmp[i] = pos[i].x - pos[i].t * V;
  }
  sort(pos + 1, pos + 1 + n);
  sort(tmp, tmp + n + 1);
  for (i = 0; i <= n; ++i) {
    if (i == 0 || tmp[i] != tmp[i - 1]) disc.push_back(tmp[i]);
  }
  printf("%d %d\n", solve(1), solve(2));
  return 0;
}
