#include <cstdio>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
int n;
ll segAdd[444444],segMax[444444];
void init(int n_){
  n = 1;
  while( n < n_) n *= 2;
}

//[a,b)
void add(int a,int b,int x,int k,int l,int r){
  if(r <= a || b <= l) return;

  if(a <= l && r <= b){
    segAdd[k] += x;
    while(k){
      k = (k-1)/2;
      segMax[k] = max(segMax[2*k+1] + segAdd[2*k+1],segMax[2*k+2] + segAdd[2*k+2]);
    }
  }else{
    add(a,b,x,2*k+1,l,(l+r)/2);
    add(a,b,x,2*k+2,(l+r)/2,r);
  }
}

ll getMax(int a,int b,int k,int l,int r){
  if(r <= a || b <= l) return -11111111111;

  if(a <= l && r <= b) return segMax[k] + segAdd[k];

  ll left  = getMax(a,b,2*k+1,l,(l+r)/2);
  ll right = getMax(a,b,2*k+2,(l+r)/2,r);

  return max(left,right) + segAdd[k];
}

int H,d[111111],h[111111];
int main(void){
  cin >> n >> H;
  for(int i = 0; i < n-1; i++){
    cin >> d[i] >> h[i];
  }

  int res = 0;
  priority_queue<pair<int,int> > que;
  add(0,1,H,0,0,n);
  for(int i = 0; i < n-1; i++){
    que.push(make_pair(h[i],i));
    while(1){
      if(getMax(i,i+1,0,0,n) - d[i] > 0) break;
      if(que.empty()) break;
      int f = que.top().first;
      int s = que.top().second;
      if(getMax(s,i+1,0,0,n) + f <= H){
	int k1 = (H-getMax(s,i+1,0,0,n))/f;
	int k2 = (d[i]-getMax(i,i+1,0,0,n))/f + 1;
	add(s,i+1,f*min(k1,k2),0,0,n);
	res += min(k1,k2);
      }else{
	que.pop();
	que.push(make_pair(H - getMax(s,i+1,0,0,n),s));
      }
    }
    add(i+1,i+2,getMax(i,i+1,0,0,n) - d[i],0,0,n);
  }
  cout << res << endl;
}