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

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#pragma GCC optimize("unroll-loops")
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stdio.h>
#include <fstream>
#include <cmath>
#include <stdlib.h>
#include <iomanip>
#include <algorithm>
#include <limits.h>
#include <stack>
#include <cmath>
#include <math.h>
#include <array>
#include <bitset>
#include <functional>
using namespace std;
#define FAST_IO ios::sync_with_stdio(false);
#define DEBUG_VIS(x) cerr<<"vis "<<x<<endl;
#define DEBUG_REACH cerr<<"reach here"<<endl;
#define DEBUG_SEQ(x) cerr<<x<<" ";
#define SET_ZERO(x) memset(x,0,sizeof(x));
#define SET_NEGONE(x) memset(x,-1,sizeof(x));
#define SET_INF(x) memset(x,127,sizeof(x));
#define SET_NEGINF(x) memset(x,128,sizeof(x));
#define IS_INF(x) x < 2100000000
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
typedef pair<double,double> pdd;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
const int maxn = 1e6 + 10;
template <class T> T mymin(const T a,const T b){return a < b ? a : b;}
template <class T> T mymax(const T a,const T b){return a > b ? a : b;}
int N,V,tot,dp[maxn];
vector<pii> v;
vector<ll> a;
map<ll,int> mp;
int tree[maxn<<2];
void change(int cur,int l,int r,int a,int b,int delta){
    if(a <= l && r <= b){
        tree[cur] = delta;
        return;
    }
    int mid = (l + r) / 2;
    if(a <= mid) change(cur<<1,l,mid,a,b,delta);
    if(b > mid) change(cur<<1|1,mid + 1,r,a,b,delta);
    tree[cur] = max(tree[cur<<1],tree[cur<<1|1]);
}
int query(int cur,int l,int r,int a,int b){
    if(a <= l && r <= b){
        return tree[cur];
    }
    int mid = (l + r) / 2;
    int ans = 0 ;
    if(a <= mid) ans = max(ans,query(cur<<1,l,mid,a,b));
    if(b > mid) ans = max(ans,query(cur<<1|1,mid + 1,r,a,b));
    return ans; 
}
int solve(){
    int ans = 0 ;
    for(int i = 0; i < v.size(); i++){
        int x = v[i].first,t = v[i].second;
        ll val1 = (ll)x - (ll) V * t;
        ll val2 = (ll) x + (ll)V * t;
        int prev_mx = query(1,1,tot,mp[val1],mp[val2]);
        dp[i] = prev_mx + 1;
        ans = max(ans,dp[i]);
        change(1,1,tot,mp[x],mp[x],dp[i]);
    }
    return ans;
}
int main(){
    #ifndef ONLINE_JUDGE
        freopen("data.in","r",stdin);
    #endif
    FAST_IO
    cin>>N;
    for(int i = 1; i <= N; i++){
        int x,t;
        cin>>x>>t;
        a.emplace_back(x);
        v.emplace_back(make_pair(x,t));
    }
    cin>>V;
    a.emplace_back(0);
    sort(v.begin(),v.end(),[](auto x,auto y){return x.second < y.second;});
    for(int i = 0; i < v.size(); i++){
        a.emplace_back((ll)v[i].first + (ll)v[i].second * V);
        a.emplace_back((ll)v[i].first - (ll)v[i].second * V);
    }
    sort(a.begin(),a.end(),[](auto x,auto y){return x < y;});
    a.erase(unique(a.begin(),a.end()),a.end());
    for(int i = 0; i < a.size(); i++) mp[a[i]] = ++tot;
    change(1,1,tot,mp[0],mp[0],1);
    cout<<solve() - 1<<" ";
    SET_ZERO(tree)
    cout<<solve()<<endl;
    return 0;
}
