#include<stdio.h>
#include<map>
#define INF 20000000
using namespace std;
typedef pair<int,int> P;
int d[100000];
int p[100000];
P deq[200000];
int max(int a,int b){return a>b?a:b;}
int min(int a,int b){return a<b?a:b;}
int main(){
	int n,mh;
	int i;
	scanf("%d %d",&n,&mh);
	for(i=0;i<n-1;i++)scanf("%d %d",&d[i],&p[i]);
	long long ans=0;
	int l=0,r=0;
	int s=0,t=0;
	int lim=0;
	int h=mh;
	while(r<n-1){
		while(s<t&&deq[t-1].first<p[r])t--;
		deq[t++]=P(p[r],r);
		while(h<=d[r]){
			while(l<r&&min(lim,p[l])<deq[s].first){
				lim+=d[l++];
				while(s<t&&deq[s].second<=l)s++;
			}
			int rec=d[r]-h+1;
			int a=rec/p[l];
			int b=lim/p[l];
			int c=min(a,b);
			if(c==0)c++;
			ans+=c;
			int add=c*p[l];
			if(add>lim)add=lim;
			lim-=add;
			h+=add;
			if(h>mh)h=mh;
		}
		h-=d[r];
		r++;
	}
	printf("%lld\n",ans);
	return 0;
}