#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }


const int MAX = 100100;
const int INF = 1<<29;

int SIZE_R;
struct RMQ {
    pair<int, int> dat[4*MAX];
    
    void init(int n = MAX, int v = -INF) {
        SIZE_R = 1;
        while (SIZE_R < n) SIZE_R *= 2; 
        for (int i = 0; i < 2*MAX-1; ++i) dat[i] = make_pair(v, -1);
    }
    
    inline void set(int a, int x) { 
        int k = a + SIZE_R-1;
        dat[k] = make_pair(x, a);
    }
    
    void init_tree(int k = 0, int l = 0, int r = SIZE_R) {
        if (r - l == 1) {}                  // leaf
        else {
            init_tree(k*2+1, l, (l+r)/2);
            init_tree(k*2+2, (l+r)/2, r);
            dat[k] = max(dat[k*2+1], dat[k*2+2]);
        }
    }
    
    inline void update(int a, int x) {
        int k = a + SIZE_R-1;
        dat[k] = make_pair(x, a);
        while (k > 0) {
            k = (k-1)/2;
            dat[k] = max(dat[k*2+1], dat[k*2+2]);
        }
    }
    
    inline pair<int, int> get(int a, int b, int k = 0, int l = 0, int r = SIZE_R) {
        if (r <= a || b <= l) return pair<int, int>(-INF, -1);
        if (a <= l && r <= b) return dat[k];
        else {
            pair<int, int> vl = get(a, b, k*2+1, l, (l+r)/2);
            pair<int, int> vr = get(a, b, k*2+2, (l+r)/2, r);
            return max(vl, vr);
        }
    }
    
    void print(int r = SIZE_R) {
        for (int i = 0; i < SIZE_R; ++i) {cout << get(i, i+1) << ",";}
        cout << endl;
    }
};

RMQ rmq;


int N;
long long H;
int d[MAX], r[MAX];

long long sum[MAX];
int next[MAX];

int main() {
    //freopen( "/Users/macuser/Dropbox/Contest/input.in", "r", stdin );
    
    while (cin >> N >> H) {
        --H;
        rmq.init(N+1);
        for (int i = 1; i < N; ++i) {
            cin >> d[i] >> r[i];
            rmq.set(i, r[i]);
        }
        rmq.init_tree(); 
        
        for (int i = 0; i <= N; ++i) next[i] = N;
        stack<pint> st;
        st.push( pint(1<<29, -1) );
        for (int i = 1; i < N; ++i) {
            if (r[i] <= st.top().first) {
                st.push( pint(r[i], i) );
            }
            else {
                while (true) {
                    pint p = st.top();
                    if (p.first < r[i]) { next[p.second] = i; st.pop(); }
                    else { st.push(pint(r[i], i) ); break; }
                }
            }
        }
        
        //memset(sum, 0, sizeof(sum));
        for (int i = 0; i <= N; ++i) sum[i+1] = sum[i] + d[i+1];
        
        
        int pos = 1, hp = H;
        int res = 0;
        
        while (true) {
            int H_MAX = hp + (H - hp) / r[pos] * r[pos];
            
            int npos = next[pos];
            long long need = sum[npos-1] - sum[pos-1];
            
//            cout << endl;
//            COUT(pos);
//            COUT(hp);
//            COUT(H_MAX);
//            COUT( next[pos]);
//            COUT(need);
            
            if (need > H_MAX) {
                int add1 = (H_MAX - hp) / r[pos];
                res += add1;
                
                int lo = pos, hi = npos;
                while (hi - lo > 1) {
                    int med = (lo + hi) / 2;
                    long long deg = sum[med-1] - sum[pos-1];
                    if (deg > H_MAX) hi = med;
                    else lo = med;
                }
                
                rmq.update(pos, H - H_MAX);
                pint np = rmq.get(pos, lo+1);
                
                //COUT(lo); COUT(np);
                
                npos = np.second;
                
                if (npos == pos) {
                    res += 1;
                    hp = H;
                }
                else {
                    long long need = sum[npos-1] - sum[pos-1];
                
                    hp = H_MAX - need;
                    pos = npos;
                }
            }
            else {
                if (hp >= need) {
                    hp -= need;
                }
                else {
                    long long need_up = need - hp;
                    long long add = (need_up + r[pos] - 1) / r[pos];
                    
                    res += add;
                    hp += add * r[pos] - need;
                }
                pos = npos;
            }
            
            //cout << pos << ", " << hp << "(" << res << ")" << endl;
            
            if (pos >= N) break;
        }
        
        cout << res << endl;
    }
    
    return 0;
}


Measured memory_bytes: 6300