#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:16000000")
#pragma warning(disable : 4996)
const int inf = 1 << 25;
const double eps = 1e-9;
vector<int> ids;
vector<pair<int, int> > LR;
vector<int> x, t;
bool cmp(int i, int j) {
  return LR[i].first > LR[j].first ||
         LR[i].first == LR[j].first && LR[i].second < LR[j].second;
}
struct Tree {
  static const int MAXN = 1 << 17;
  int a[2 * MAXN];
  Tree(int val) {
    for (int i = (0); i < (2 * MAXN); ++i) a[i] = val;
  }
  void update(int i, int val) {
    i += MAXN;
    if (a[i] > val) return;
    a[i] = val;
    int p = i >> 1;
    while (p > 0) a[p] = std::max(a[i], a[i ^ 1]), p >>= 1, i >>= 1;
  }
  int max(int i, int j) {
    i += MAXN, j += MAXN;
    int ret = -inf;
    while (i < j) {
      if (i & 1)
        ret = std::max(ret, a[i++]);
      else if (!(j & 1))
        ret = std::max(ret, a[j--]);
      else
        i >>= 1, j >>= 1;
    }
    return std::max(ret, a[i]);
  }
};
int f(bool zeroFirst) {
  Tree T(zeroFirst ? -inf : 0);
  int ans = 0;
  for (int j = (0); j < ((int)ids.size()); ++j) {
    int i = ids[j];
    if (t[i] == 0) {
      if (zeroFirst) T.update(LR[i].second, 0);
      continue;
    }
    int a = 1 + T.max(0, LR[i].second);
    if (a > 0) T.update(LR[i].second, a);
    ans = max(ans, a);
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  x.resize(n), t.resize(n);
  for (int i = (0); i < (n); ++i) cin >> x[i] >> t[i];
  int V;
  cin >> V;
  LR.resize(n);
  for (int i = (0); i < (n); ++i)
    LR[i] = pair<int, int>(x[i] - V * t[i], x[i] + V * t[i]);
  x.push_back(0);
  t.push_back(0);
  LR.push_back(pair<int, int>(0, 0));
  vector<int> scaling;
  for (int i = (0); i < ((int)LR.size()); ++i) scaling.push_back(LR[i].second);
  sort(scaling.begin(), scaling.end());
  scaling.resize(unique(scaling.begin(), scaling.end()) - scaling.begin());
  for (int i = (0); i < ((int)LR.size()); ++i)
    LR[i].second = lower_bound(scaling.begin(), scaling.end(), LR[i].second) -
                   scaling.begin();
  ids.resize(n + 1);
  for (int i = (0); i < (n + 1); ++i) ids[i] = i;
  sort(ids.begin(), ids.end(), cmp);
  cout << f(true) << " " << f(false) << endl;
  return 0;
}
