#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<ll,P> P1;

#define rep(i,x) for(ll i = 0 ; i < x ; i ++)
#define rep1(i,x) for(ll i = 1 ; i <= x ; i ++)
#define rrep(i,x) for(ll i = x-1 ; i >= 0 ; i --)
#define rrep1(i,x) for(ll i = x ; i > 0 ; i --)
#define sor(vec) sort(vec.begin(),vec.end())
#define rev(vec) reverse(vec.begin(),vec.end())
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define min_3(a,b,c) min(min(a,b),c)
#define max_3(a,b,c) max(max(a,b),c)
#define mp1(a,b,c) P1(a,P(b,c))
#define fr first
#define sc second
#define pb push_back

const ll INF = 1000000000000000000;
const ll dir_4[4][2] = { {1,0} , {0,1} , {-1,0} , {0,-1} };

ll siz;
ll seg[2][400010];

void init(ll n){
	siz = 1;
	while(siz < n)siz *= 2;
	rep(i,siz*2-1){
		seg[0][i] = -INF;
		seg[1][i] = 0;
	}
}

ll query(ll k){
	ll sum = 0;
	k += siz-1;
	ll ret = seg[0][k];
	while(k > 0){
		k = (k-1)/2;
		ret = max ( ret + seg[1][k] , seg[0][k] );
	}
	return ret;
}

void maxi(ll a,ll b,ll x,ll k,ll l,ll r){
	if(b <= l || r <= a)return;
	if(a <= l && r <= b){
		seg[0][k] = max ( seg[0][k] , x );
		return;
	}
	maxi(a,b,x-seg[1][k],2*k+1,l,(l+r)/2);
	maxi(a,b,x-seg[1][k],2*k+2,(l+r)/2,r);
}

void add(ll a,ll b,ll x,ll k,ll l,ll r){
	if(b <= l || r <= a)return;
	if(a <= l && r <= b){
		seg[0][k] += x;
		seg[1][k] += x;
		return;
	}
	add(a,b,x,2*k+1,l,(l+r)/2);
	add(a,b,x,2*k+2,(l+r)/2,r);
}

void updata(ll k,ll x){
	add(k,k+1,x-query(k),0,0,siz);
}

int main(){
	ll n,h;
	static ll c[100010],d[100010];
	
	scanf("%lld%lld",&n,&h);
	rep1(i,n-1){
		scanf("%lld%lld",&c[i],&d[i]);
	}
	
	init(n+10);
	updata(0,h);
	c[0] = 0;
	
	priority_queue<P> que;
	ll ret = 0;
	
	rep1(i,n-1){
		updata(i,query(i-1)-c[i-1]);
		que.push( P ( d[i] , i ) );
		ll t = c[i] - query(i) + 1;
		while(t > 0){
			P p = que.top(); que.pop();
			ll s1 = (t+p.fr-1)/p.fr;
			ll s2 = (h-query(p.sc))/p.fr;
			if(s1 < s2){
				maxi(0,p.sc,query(p.sc)+p.fr*s1,0,0,siz);
				add(p.sc,siz,p.fr*s1,0,0,siz);
				t -= p.fr*s1;
				ret += s1;
				que.push(p);
			}
			else {
				maxi(0,p.sc,query(p.sc)+p.fr*s2,0,0,siz);
				add(p.sc,siz,p.fr*s2,0,0,siz);
				t -= p.fr*s2;
				ret += s2;
				que.push( P ( h-query(p.sc) , p.sc ) );
			}
		}
	}
	
	printf("%lld\n",ret);
				
}