#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define mod 1000000007 //1e9+7
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100000

int main(){
  int n,h;
  int d[SIZE],u[SIZE];
  
  scanf("%d%d",&n,&h);

  for(int i=0;i<n-1;i++){
    scanf("%d%d",d+i,u+i);

  }

  ll ans = 0;
  int l = 0;
  int power = h;
  ll powermemo[SIZE] = {};
  ll sum[SIZE] = {};
  ll now_sum = 0;
  
  priority_queue<pair<int,int> > pq;
  
  for(int i=0;i<n-1;i++){
    //cerr << i << " : " << power << endl;
    
    pq.push({u[i],i});
    powermemo[i] = power;

    while(power-d[i] <= 0){

      //cerr << "power" << " : " << power << endl;
      
      int max_add = 0;
      int max_l = 0;
      int add_ans = 0;
      bool back = false;
      pair<int,int> p,max_p;
      
      while(1){
	if(pq.empty()) break;
	
	p = pq.top();
	pq.pop();

	//cerr << "p = {" << p.first << " : " << p.second << "} " << pq.size() << endl;
	
	if(p.second < l) continue;
	
	if(h - (powermemo[p.second]+(now_sum + sum[p.second])) <= p.first){
	  
	  ll add = h - (powermemo[p.second]+(now_sum + sum[p.second]));

	  //cerr << h << "-(" << powermemo[p.second] << " + " << now_sum << " + " << sum[p.second] << ")" <<endl;
	  //cerr << "a = " << add << endl;
	  
	  if(max_add < add || (max_add == add && max_l < p.second)){
	    max_l = p.second;
	    max_add = add;
	    max_p = p;
	    add_ans = 1;
	    back = false;
	  }
	  
	}else{
	  
	  if(max_add > p.first){
	    pq.push(p);
	    break;
	  }
	  
	  ll t = h - (powermemo[p.second]+(now_sum + sum[p.second]));
	  
	  ll add = min(t/p.first * p.first,
		       (ll)((d[i]-power)/p.first + 1) * p.first);
	  
	  if(max_add < add ||  (max_add == add && max_l < p.second)){
	    max_l = p.second;
	    max_add = add;
	    max_p = p;
	    add_ans = add/p.first;
	    back = true;
	  }
	  
	  break;
	}
	
      } //while
      
      l = max_l;
      power += max_add;
      now_sum += max_add;
      sum[i] -= max_add;
      ans += add_ans;
      
      if(back) pq.push(max_p);
      
      //cerr << "add : " <<  max_add << " (" << add_ans << ")" << max_l << endl;
      assert(max_add>0);
      
      powermemo[i] = power;
    }
    
    
    sum[i+1] += sum[i];
    powermemo[i] = power;
    power -= d[i];
  }
  
  printf("%lld\n",ans);
  
  return 0;
}