import std.stdio;
import core.stdc.stdio;
import std.typecons;
import std.algorithm;

void main(){
	int n;
	long h;
	scanf("%d%lld",&n,&h);
	long[] ds = new long[n];
	long[] hs = new long[n-1];
	for(int i=0;i<n-1;i++)
		scanf("%lld%lld",&ds[i+1],&hs[i]);
	for(int i=1;i<n;i++)
		ds[i] += ds[i-1];
	//ds.writeln;
	long heal=0;
	long ans=0;
	int b=0;
	int e=0;
	alias Tuple!(int,"prev",int,"next") pn;
	pn[] list = new pn[n];
	for(int i=0;i<n;i++)
		list[i] = pn(i,i);
	for(int s=1;s<n;s++){
			/*
			s.writeln;
			writeln(b," ",e," ",list[b].next);
			writeln("heal ",heal);
			writeln;
			*/
		while(h<=ds[s]-heal){
			while(list[b].next != b){
				int k = list[b].next;
				if(min(ds[b]-heal,hs[b])<=min(ds[k]-heal,hs[k]))
					b=k;
				else
					break;
			}
			list[b].prev = b;
			
			long t = min(ds[b]-heal,ds[s]-heal-h+1);
			//t.writeln;	
			if(t>=hs[b]){
				long c = t/hs[b];
				ans += c;
				heal += hs[b]*c;
			}else{
				ans++;
				heal += min(ds[b]-heal,hs[b]);
			}
		}
		if(s==n-1)
			break;
		list[s].prev = e;
		list[e].next = s;
		e = s;
		while(1){
			int k=list[e].prev;
			if(hs[k]<=hs[e]){
				if(k==b){
					list[e].prev = e;
					b=e;
					break;
				}else{
					list[e].prev = list[k].prev;
					list[list[e].prev].next = e;
				}
			}else
				break;
		}
		//writeln;
	}
	printf("%lld\n",ans);
}