#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 50;
const int MAX_N = 1 << 17;
const int def = 0;

struct MaxSegTree2 {
	int n;
	ll segMax[2 * MAX_N - 1], segAdd[2 * MAX_N - 1];
	void init(int n_) {
		n = 1;
		while(n < n_) n *= 2;
		for(int i = 0; i < 2 * n - 1; i++) segMax[i] = def;
	}

	void add(int a, int b, ll x) { add(a, b, x, 0, 0, n); }

	void add(int a, int b, ll x, int k, int l, int r) {
		if(r <= a || b <= l) return;
		if(a <= l && r <= b) {
			segAdd[k] += x;
			return;
		}
		add(a, b, x, k * 2 + 1, l, (l + r) / 2);
		add(a, b, x, k * 2 + 2, (l + r) / 2, r);
		segMax[k] = max(segMax[k * 2 + 1] + segAdd[k * 2 + 1], segMax[k * 2 + 2] + segAdd[k * 2 + 2]);
	}

	ll query(int a, int b) { return query(a, b, 0, 0, n); }

	ll query(int a, int b, int k, int l, int r) {
		if(r <= a || b <= l) return -INF;
		if(a <= l && r <= b) return segMax[k] + segAdd[k];
		ll vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
		ll vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
		return max(vl, vr) + segAdd[k];
	}
};

MaxSegTree2 st;
typedef pair<ll, int> P;

ll d[100000];
ll heal[100000];
int c[1000000];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	//ifstream ifs("input.txt");
	//cin.rdbuf(ifs.rdbuf());
	//ofstream ofs("output.txt");
	//cout.rdbuf(ofs.rdbuf());

	int N, H;
	cin >> N >> H;
	st.init(N);
	st.add(0, N, H);
	for(int i = 0; i < N - 1; i++) {
		cin >> d[i] >> heal[i];
		st.add(i + 1, N, -d[i]);
	}
	ll hp = H, ans = 0;
	priority_queue<P> q; // <head,idx>
	for(int i = 0; i < N - 1; i++) {
		////cerr << "d : " << d[i] << ", heal : " << heal[i] << endl;
		q.push({ heal[i], i });
		if(hp - d[i] >= 1) {
			hp -= d[i];
		}
		else {
			while(hp - d[i] <= 0) {
				P p = q.top();
				q.pop();
				ll h = p.first, idx = p.second;

				ll x = -hp + d[i] + 1;
				ll rem = H - st.query(idx, N);
				assert(rem >= 0);
				if(rem == 0) continue;
				if(rem < h) {
					q.push({ rem, idx });
					continue;
				}
				int cnt = (x + h - 1) / h;
				if(h * cnt > rem) cnt = rem / h;
				//cerr << "idx : " << idx << ", h : " << h << ", cnt : " << cnt << endl;
				//cerr << hp << " -> ";
				hp = min(ll(H), hp + h * cnt);
				//cerr << hp << endl;
				ans += cnt;
				c[idx] += cnt;
				st.add(idx, N, h * cnt);
				rem -= h * cnt;
				if(rem > 0) {
					q.push({ min(rem, h), idx });
				}
			}
			hp -= d[i];
		}
		/*for(int j = 0; j < N - 1; j++) {
			cout << st.query(j, j + 1) << " ";
			}
			cout << endl;*/
		//cerr << "hp : " << hp << endl;

	}
	cout << ans << endl;

	hp = H;
	for(int i = 0; i < N; i++) {
		hp = min(ll(H), hp + c[i] * heal[i]);
		hp -= d[i];
		assert(hp >= 1);
	}
}