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 MAX = 1 << 28;
struct SegmentTree {
  const int xl, xr, xm;
  map<long long, int> ys;
  SegmentTree *_pl, *_pr;
  SegmentTree(int xl, int xr)
      : xl(xl), xr(xr), xm((xl + xr) / 2), _pl(NULL), _pr(NULL) {}
  SegmentTree* pl() {
    return _pl == NULL ? (_pl = new SegmentTree(xl, xm)) : _pl;
  }
  SegmentTree* pr() {
    return _pr == NULL ? (_pr = new SegmentTree(xm, xr)) : _pr;
  }
  void add(int x, long long y, int z) {
    map<long long, int>::iterator it = ys.lower_bound(y);
    if (it == ys.end() || it->second < z) {
      while (it != ys.begin()) {
        --it;
        if (it->second > z) {
          break;
        } else {
          ys.erase(it);
          it = ys.lower_bound(y);
        }
      }
      ys.insert(make_pair(y, z));
    }
    if (xr - xl > 1) {
      if (x < xm) {
        pl()->add(x, y, z);
      } else {
        pr()->add(x, y, z);
      }
    }
  }
  int max(int l, int r, long long y) {
    if (ys.empty() || (xl == l && xr == r)) {
      map<long long, int>::iterator it = ys.lower_bound(y);
      return it == ys.end() ? 0 : it->second;
    } else if (r <= xm) {
      return pl()->max(l, r, y);
    } else if (xm <= l) {
      return pr()->max(l, r, y);
    } else {
      return std::max(pl()->max(l, xm, y), pr()->max(xm, r, y));
    }
  }
};
int main() {
  int n, a, b;
  long long m;
  vector<pair<int, int> > v;
  scanf("%d", &n);
  v.resize(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &v[i].second, &v[i].first);
  }
  scanf("%I64d", &m);
  v.push_back(make_pair(0, 0));
  sort(v.rbegin(), v.rend());
  SegmentTree* lft = new SegmentTree(-MAX, MAX);
  SegmentTree* rt = new SegmentTree(-MAX, MAX);
  a = b = 0;
  for (int i = 0; i < (int)v.size(); ++i) {
    int dp =
        1 + max(lft->max(-MAX, v[i].second + 1, m * v[i].first + v[i].second),
                rt->max(v[i].second, MAX, m * v[i].first - v[i].second));
    if (v[i].first == 0) {
      a = max(a, dp);
    } else {
      b = max(b, dp);
    }
    lft->add(v[i].second, m * v[i].first + v[i].second, dp);
    rt->add(v[i].second, m * v[i].first - v[i].second, dp);
  }
  printf("%d %d\n", a - 1, b);
  return 0;
}
