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 <cstdio>
#include <map>

using namespace std;

const int N(100001);
const int INF(1e9);

map<int,int> compressed;
int reverse[N], input[N][2];
int overall, all;

inline int findleft(int x){
    int l = 1;
    int r = x;
    int ans = -1;
    while(l <= r){
        int m = (l + r) >> 1;
        if(reverse[x] - reverse[m] <= overall){
            ans = m;
            r = m - 1;
        }else{
            l = m + 1;
        }
    }
    return ans;
}

inline int findright(int x){
    int l = x;
    int r = all;
    int ans = -1;
    while(l <= r){
        int m = (l + r) >> 1;
        if(reverse[m] - reverse[x] <= overall){
            ans = m;
            l = m + 1;
        }else{
            r = m - 1;
        }
    }
    return ans;
}

struct Segment{
    int a, b, v;
    int arr[N * 3];
    
    Segment(){
        for(int& i : arr) i = -INF;
    }
    
    inline bool intersect(int l, int r){
        return max(a, l) <= min(b, r);
    }
    
    inline void adjust(int& a, int v){
        a = max(a, v);
    }
    
    void update(int node, int l, int r){
        if(not intersect(l, r)) return;
        if(a <= l and r <= b){
            adjust(arr[node], v);
            return;
        }
        adjust(arr[node << 1], arr[node]);
        adjust(arr[(node << 1) + 1], arr[node]);
        update(node << 1, l, (l + r) >> 1);
        update((node << 1) + 1, ((l + r) >> 1) + 1, r);
    }
    
    int query(int node, int l, int r){
        if(not intersect(l, r)) return -INF;
        if(l == r) return arr[node];
        adjust(arr[node << 1], arr[node]);
        adjust(arr[(node << 1) + 1], arr[node]);
        return max(query(node << 1, l, (l + r) >> 1), query((node << 1) + 1, ((l + r) >> 1) + 1, r));
    }
    
    void adjust(int _l, int _r, int _v){
        a = _l; b = _r; v = _v;
        update(1, 1, all);
    }
    
    int RMQ(int _x){
        a = _x; b = _x;
        return query(1, 1, all);
    }
}Seg;

int main(){
    int n, xmax, x, t;
    scanf("%d", &n); n++;
    compressed[0] = 0;
    for(int i = 2; i <= n; ++i){
        scanf("%d %d", &x, &t);
        input[i][0] = x;
        input[i][1] = t;
        compressed[x] = 0;
    }
    scanf("%d", &xmax);
    all = 0;
    for(pair<const int,int>& i : compressed){
        i.second = ++all;
        reverse[all] = i.first;
    }
    // TODO: n = 1 ?
    for(int t = n; t >= 2; --t){
        int x = compressed[input[t][0]];
        overall = (input[t][1] - input[t - 1][1]) * xmax;
        Seg.adjust(x, x, 1);
        Seg.adjust(findleft(x), findright(x), Seg.RMQ(x) + 1);
    }
    int vmax = 0;
    for(int i = 1; i <= all; ++i) vmax = max(vmax, Seg.RMQ(i));
    printf("%d %d\n", Seg.RMQ(compressed[0]) - 1, vmax - 1);
    return 0;
}
