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;
int N, V, Xn;
pair<int, int> P[100010];
vector<int> X;
map<int, int> dx;
int dp[100010];
int Yn, Zn;
vector<long long> Y, Z;
map<long long, int> dy, dz;
void Add(pair<int, int> val, deque<pair<int, int> > &dq) {
  if (!dq.empty() && dq.back().first > val.first)
    while (1)
      ;
  if (dq.empty() || dq.back().second < val.second) dq.push_back(val);
}
struct BIT {
  vector<deque<pair<int, int> > > tree;
  void init() {
    tree = vector<deque<pair<int, int> > >(4 * Yn, deque<pair<int, int> >());
  }
  void upd(int idx, pair<int, int> val, int l, int r, int n) {
    if (idx < l || r < idx) return;
    Add(val, tree[n]);
    if (l == r) return;
    int m = (l + r) >> 1;
    upd(idx, val, l, m, 2 * n);
    upd(idx, val, m + 1, r, 2 * n + 1);
  }
  int quer(int a, int b, int x, int l, int r, int n) {
    if (b < l || r < a) return 0;
    if (a <= l && r <= b) {
      while (tree[n].size() >= 2 && tree[n][1].first <= x) tree[n].pop_front();
      if (tree[n].empty() || tree[n].front().first > x)
        return 0;
      else
        return tree[n].front().second;
    }
    int m = (l + r) >> 1;
    int L = quer(a, b, x, l, m, 2 * n);
    int R = quer(a, b, x, m + 1, r, 2 * n + 1);
    return max(L, R);
  }
} bit;
bool cmp(pair<int, int> a, pair<int, int> b) {
  long long l = (long long)-X[a.second] - (long long)a.first * V;
  long long r = (long long)-X[b.second] - (long long)b.first * V;
  return l > r || (l == r && a.first < b.first);
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d %d", &P[i].second, &P[i].first);
    X.push_back(P[i].second);
  }
  P[N++] = pair<int, int>(0, 0);
  X.push_back(0);
  scanf("%d", &V);
  sort(X.begin(), X.end());
  X.resize(unique(X.begin(), X.end()) - X.begin());
  Xn = X.size();
  for (int i = 0; i < Xn; i++) dx[X[i]] = i;
  for (int i = 0; i < N; i++) {
    P[i].second = dx[P[i].second];
  }
  for (int i = 0; i < N; i++) {
    Y.push_back((long long)X[P[i].second] - (long long)P[i].first * V);
    Z.push_back((long long)-X[P[i].second] - (long long)P[i].first * V);
  }
  sort(Y.begin(), Y.end());
  sort(Z.begin(), Z.end());
  Y.resize(unique(Y.begin(), Y.end()) - Y.begin());
  Z.resize(unique(Z.begin(), Z.end()) - Z.begin());
  Yn = Y.size();
  Zn = Z.size();
  for (int i = 0; i < Yn; i++) dy[Y[i]] = i;
  for (int i = 0; i < Zn; i++) dz[Z[i]] = i;
  sort(P, P + N, cmp);
  bit.init();
  for (int i = N - 1; i >= 0; i--) {
    dp[i] =
        1 + bit.quer(0,
                     dy[(long long)X[P[i].second] - (long long)P[i].first * V],
                     dz[(long long)-X[P[i].second] - (long long)P[i].first * V],
                     0, Yn - 1, 1);
    bit.upd(
        dy[(long long)X[P[i].second] - (long long)P[i].first * V],
        pair<int, int>(
            dz[(long long)-X[P[i].second] - (long long)P[i].first * V], dp[i]),
        0, Yn - 1, 1);
  }
  int ans1 = 0;
  int ans2 = 0;
  for (int i = 0; i < N; i++) {
    if (P[i].first)
      ans2 = max(ans2, dp[i]);
    else
      ans1 = dp[i] - 1;
  }
  printf("%d %d", ans1, ans2);
}
