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;
const int maxn = 1e5 + 2;
const int inf = 1e9;
struct event {
  int x, t, id, idM;
  bool flag;
  event() {}
};
event a[maxn];
int tree[maxn * 4];
bool cmpM(event a, event b) { return a.x - a.t < b.x - b.t; }
bool cmpP(event a, event b) {
  return a.x + a.t < b.x + b.t ||
         (a.x + a.t == b.x + b.t && a.x - a.t > b.x - b.t);
}
void init(int v, int ll, int rr, int val) {
  if (ll + 1 == rr) return void(tree[v] = val);
  init(v * 2 + 1, ll, (ll + rr) / 2, val);
  init(v * 2 + 2, (ll + rr) / 2, rr, val);
  tree[v] = max(tree[v * 2 + 1], tree[v * 2 + 2]);
}
void add(int v, int ll, int rr, int pos, int val) {
  if (ll >= pos + 1 || pos >= rr) return;
  if (ll + 1 == rr) return void(tree[v] = val);
  add(v * 2 + 1, ll, (ll + rr) / 2, pos, val);
  add(v * 2 + 2, (ll + rr) / 2, rr, pos, val);
  tree[v] = max(tree[v * 2 + 1], tree[v * 2 + 2]);
}
int getMax(int v, int ll, int rr, int l, int r) {
  if (ll >= r || l >= rr) return -inf;
  if (l <= ll && rr <= r) return tree[v];
  return max(getMax(v * 2 + 1, ll, (ll + rr) / 2, l, r),
             getMax(v * 2 + 2, (ll + rr) / 2, rr, l, r));
}
int main() {
  int n, ans1 = 0, ans2 = 0, v, cur, r, p = -1, z = -1;
  scanf("%d", &n);
  a[0].x = a[0].t = 0;
  for (int i = 0; i < n; i++) scanf("%d%d", &a[i + 1].x, &a[i + 1].t);
  n++;
  scanf("%d", &v);
  for (int i = 0; i < n; i++) a[i].t *= v;
  for (int i = 0; i < n; i++) a[i].flag = 0;
  a[0].flag = 1;
  sort(a, a + n, cmpM);
  cur = 0;
  for (int i = 0; i < n; i++) {
    a[i].idM = cur;
    if (-a[i].x + a[i].t == 0) {
      z = i;
      p = cur;
    }
    if (i + 1 == n || a[i].x - a[i].t != a[i + 1].x - a[i + 1].t) cur++;
  }
  a[z] = a[n - 1];
  n--;
  sort(a, a + n, cmpP);
  init(0, 0, cur, -inf);
  add(0, 0, cur, p, 0);
  for (int i = 0; i < n; i++) {
    if (a[i].x + a[i].t < 0) continue;
    r = getMax(0, 0, cur, a[i].idM, cur);
    if (r >= 0) {
      r++;
      ans1 = max(r, ans1);
      add(0, 0, cur, a[i].idM, r);
    }
  }
  init(0, 0, cur, -inf);
  for (int i = 0; i < n; i++) {
    r = getMax(0, 0, cur, a[i].idM, cur);
    r++;
    r = max(1, r);
    ans2 = max(r, ans2);
    add(0, 0, cur, a[i].idM, r);
  }
  cout << ans1 << " " << ans2 << endl;
  return 0;
}
