#include <iostream>
#include <cstdio>
//#include <cstdlib>
//#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
//#include <limits>
//#include <sstream>
//#include <functional>
using namespace std;

#define len(array)  (sizeof (array) / sizeof *(array))
#define rep(i, s, e) for(int i = s;i < e;i++)
#define rrep(i, e, s) for(int i = e;s <= i;i--)
#define vrange(v) v.begin(), v.end()
#define vrrange(v) v.rbegin(), v.rend()
#define vsort(v) sort(vrange(v))
#define vrsort(v) sort(vrrange(v))
#define arange(a) a, a + len(a)
#define asort(a) sort(arange(a))
#define arsort(a, t) sort(arange(a), greater<t>())
#define afill(a, v) fill(arange(a), v)
#define afill2(a, v, t) fill((t *)a, (t *)(a + len(a)), v)
#define fmax(a, b) (a < b? b : a)
#define fmin(a, b) (a > b? b : a)
#define fabs(a) (a < 0? -a : a)
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, int> P;
const int INF = (int)1e9;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-10;
//const int dx[] = {1, -1, 0, 0, 1, -1, -1, 1};
//const int dy[] = {0, 0, 1, -1, -1, -1, 1, 1};
//const int weight[] = {0,1,10,100,1000,10000,100000,1000000,10000000};
//priority_queue<int, vector<int>, greater<int>> q;
typedef struct _Node {
  _Node(int arg1 = 0, int arg2 = 0 , int arg3 = 0) {
    i = arg1;
    j = arg2;
    k = arg3;
  }
  int i,j,k;
  bool operator <(const struct _Node &e) const{
    return i == e.i? j < e.j : i < e.i;
  }
  bool operator >(const struct _Node &e) const{
    return i == e.i? j > e.j : i > e.i;
  }
}node;

#define MAX_SIZE 100002 * 4

ll segMax[MAX_SIZE], segAddMax[MAX_SIZE];

//区間[a, b)に値xを加算する.
void addMax(int a, int b, int x, int k, int l, int r)
{
  if (r <= a || b <= l) return;
  if (a <= l && r <= b){
    segAddMax[k] += x;
    while (k){
      k = (k - 1) / 2;
      segMax[k] = fmax(segMax[k * 2 + 1] + segAddMax[k * 2 + 1], segMax[k * 2 + 2] + segAddMax[k * 2 + 2]);
    }
    return;
  }

  addMax(a, b, x, k * 2 + 1, l, (l + r) / 2);
  addMax(a, b, x, k * 2 + 2, (l + r) / 2, r);
}

ll getMax(int a, int b, int k, int l, int r)
{
  if (r <= a || b <= l) return -1;
  if (a <= l && r <= b) return (segMax[k] + segAddMax[k]);
  ll left = getMax(a, b, k * 2 + 1, l, (l + r) / 2);
  ll right = getMax(a, b, k * 2 + 2, (l + r) / 2, r);
  return (fmax(left, right) + segAddMax[k]);
}




void doIt(){
  int n, damage[100002], heal[100002];
  ll h, hp, ans = 0, tmp;
  priority_queue<P> q;
  afill(segMax, 0);
  afill(segAddMax, 0);
  scanf("%d%lld", &n, &h);
  n--;
  //cout << n << ", " << h << endl;;
  hp = h;
  rep(i, 0, n) scanf("%d %d", &damage[i], &heal[i]);
  //cout << "end." << endl;
  rep(i, 0, n){
    //cout << "i = " << i << endl;
    addMax(i, i+1, hp, 0, 0, n);
    q.push(P(heal[i], i));
    hp -= damage[i];
    //cout << "i = " << i << ", damaged hp = " << hp << endl;
    while(hp <= 0){
      P p = q.top();
      //cout << "getMax(" << p.second << ", " << i+1 << ") = " << getMax(p.second, i+1, 0, 0, n) << endl;;
      tmp = h - getMax(p.second, i+1, 0, 0, n);
      //cout << "  tmp = " << tmp << "p = " << p.first << ", " << p.second << endl;

      if(tmp <= 0 || tmp < p.first){
        q.pop();
        if(0 < tmp){
          p.first = tmp;
          q.push(p);
        }
      }
      else{
        ll t1 = fabs(hp) / p.first, t, t2;
		t2 = tmp / p.first;
        //cout << "t = " << t << ", hp = " << hp << endl;
        //if(hp <= 0){hp += p.first; t++;}
        if(p.first*(t2+1) <= tmp) t2++;
		if(p.first*t1 <= 0) t1++;
		t = fmin(t1, t2);
		hp += p.first * t;
        ans += t;
        addMax(p.second, i+1, p.first*t, 0, 0, n);
      }
    }
    //cout << "  hp = " << hp << ", count = " << ans << endl;
  }
  //cout << ans << endl;
  printf("%lld\n", ans);
}

int main() {
  doIt();
  return 0;
}

Measured memory_bytes: 8236