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 long long MAX_N = 100000 + 10;
const long long INF = 1000000;
long long N, V;
long long totX, rex[MAX_N];
map<long long, long long> mapII;
pair<long long, long long> a[MAX_N];
long long f[MAX_N], loc[MAX_N];
set<pair<long long, long long> > c1[MAX_N], c2[MAX_N];
void insert(long long p, long long x, long long t, long long v) {
  long long key;
  set<pair<long long, long long> >::iterator cur;
  key = x - V * t;
  for (long long tmp = p; tmp < totX; tmp += tmp & (-tmp)) {
    cur = c1[tmp].lower_bound(make_pair(key, -INF));
    if (cur != c1[tmp].end() && cur->second >= v) continue;
    for (;;) {
      cur = c1[tmp].upper_bound(make_pair(key, v));
      if (cur != c1[tmp].begin() && (--cur)->second <= v)
        c1[tmp].erase(cur);
      else
        break;
    }
    c1[tmp].insert(make_pair(key, v));
  }
  p = totX - p;
  key = x + V * t;
  for (long long tmp = p; tmp < totX; tmp += tmp & (-tmp)) {
    cur = c2[tmp].lower_bound(make_pair(key + 1, -INF));
    if (cur != c2[tmp].begin() && (--cur)->second >= v) continue;
    for (;;) {
      cur = c2[tmp].lower_bound(make_pair(key, -INF));
      if (cur != c2[tmp].end() && cur->second <= v)
        c2[tmp].erase(cur);
      else
        break;
    }
    c2[tmp].insert(make_pair(key, v));
  }
}
long long query(long long p, long long x, long long t) {
  long long key, ret = -INF;
  set<pair<long long, long long> >::iterator cur;
  key = x - V * t;
  for (long long tmp = p; tmp; tmp -= tmp & (-tmp)) {
    cur = c1[tmp].lower_bound(make_pair(key, -INF));
    if (cur == c1[tmp].end()) continue;
    ret = max(ret, cur->second);
  }
  key = x + V * t;
  p = totX - p;
  for (long long tmp = p; tmp; tmp -= tmp & (-tmp)) {
    cur = c2[tmp].upper_bound(make_pair(key + 1, -INF));
    if (cur == c2[tmp].begin()) continue;
    ret = max(ret, (--cur)->second);
  }
  return ret + 1;
}
void calc1() {
  for (long long(i) = 0; (i) < (long long)(N + 1); (i)++) {
    c1[i].clear();
    c2[i].clear();
  }
  long long tmp = mapII[0], ans = 0;
  insert(tmp, 0, 0, 0);
  for (long long(i) = 0; (i) < (long long)(N); (i)++) {
    f[i] = query(loc[i], a[i].second, a[i].first);
    ans = max(ans, f[i]);
    insert(loc[i], a[i].second, a[i].first, f[i]);
  }
  cout << ans << endl;
}
void calc2() {
  for (long long(i) = 0; (i) < (long long)(N + 1); (i)++) {
    c1[i].clear();
    c2[i].clear();
  }
  long long ans = 0;
  for (long long(i) = 0; (i) < (long long)(N); (i)++) {
    f[i] = max(query(loc[i], a[i].second, a[i].first), 1LL);
    ans = max(ans, f[i]);
    insert(loc[i], a[i].second, a[i].first, f[i]);
  }
  cout << ans << endl;
}
void solve() {
  cin >> N;
  totX = 0;
  for (long long(i) = 0; (i) < (long long)(N); (i)++) {
    cin >> a[i].second >> a[i].first;
    rex[totX++] = a[i].second;
  }
  cin >> V;
  sort(a, a + N);
  rex[totX++] = 0;
  sort(rex, rex + totX);
  mapII.clear();
  long long tmp = 0;
  for (long long i = 0; i < totX; ++i)
    if (i == 0 || rex[i] != rex[i - 1]) mapII[rex[i]] = ++tmp;
  totX = tmp + 1;
  for (long long i = 0; i < N; ++i) loc[i] = mapII[a[i].second];
  calc1();
  calc2();
}
int main() {
  solve();
  return 0;
}
