#include <cstdio>
#include <deque>
#include <utility>
#include <algorithm>
using namespace std;
int main() {
	long long int n,total_h,max_h,total_d=0,ans=0;
	scanf("%lld %lld",&n,&total_h);
	max_h=total_h;
	deque<pair<long long int,long long int> > Q;
	for(int i=0;i<n-1;i++) {
		long long int d,h;
		scanf("%lld %lld",&d,&h);
		while(!Q.empty()&&Q.back().first<=h)
			Q.pop_back();
		Q.push_back(make_pair(h,total_d));
		total_d+=d;
		while(total_h<=total_d) {
			long long int tmp_h=total_h;
			while(!Q.empty()&&tmp_h+Q.front().first-Q.front().second>max_h) {
				total_h=max(total_h,Q.front().second+max_h);
				Q.pop_front();
			}
			if(!Q.empty()) {
				total_h=max(total_h,tmp_h+Q.front().first);
				long long int tmp=max(0LL,min((total_d-total_h)/Q.front().first,(Q.front().second+max_h-total_h)/Q.front().first));
				ans+=tmp;
				total_h+=tmp*Q.front().first;
			}
			ans++;
		}
	}
	printf("%lld\n",ans);
}