#include <stdio.h>
#include <iostream>

using namespace std;

long long int n,h;

long long int tai[100001];
long long int kai[100000];

#define DEEP 19

long long int seg[(1 << DEEP)];

int nextk[100000];

int st[100000];

long long int segmax(int beg,int end)
{
	if(end < beg)
	{
		return -1;
	}
	int nowb1 = beg + (1 << (DEEP - 1)) - 1;
	int nowb2 = end + (1 << (DEEP - 1)) - 1;
	long long int maxw = max(seg[nowb1],seg[nowb2]);
	for(int i = 0; i < DEEP; i++)
	{
		int nowb1n = (nowb1 - 1) / 2;
		int nowb2n = (nowb2 - 1) / 2;
		if(nowb1n == nowb2n)
		{
			return maxw;
		}
		if(nowb1 % 2 == 1)
		{
			maxw = max(maxw,seg[nowb1 + 1]);
		}
		if(nowb2 % 2 == 0)
		{
			maxw = max(maxw,seg[nowb2 - 1]);
		}
		nowb1 = nowb1n;
		nowb2 = nowb2n;
	}
	return maxw;
}

int main()
{
	scanf("%lld %lld",&n,&h);
	long long int nownt = 0;
	tai[0] = 0;
	for(int i = (1 << (DEEP - 1)) - 1; i < (1 << DEEP); i++)
	{
		seg[i] = -1;
	}
	for(int i = 1; i < n; i++)
	{
		long long int dw,hw;
		scanf("%lld %lld",&dw,&hw);
		nownt += dw;
		tai[i] = nownt;
		kai[i - 1] = hw;
		seg[(1 << (DEEP - 1)) - 1 + i - 1] = hw;
	}
	tai[n] = 10000000000000;
	kai[n - 1] = 100000000;
	int stn = 0;
	for(int i = 0; i < n; i++)
	{
		for(int j = stn - 1; j >= 0; j--)
		{
			if(kai[st[j]] <= kai[i])
			{
				nextk[st[j]] = i;
				stn--;
			}
			else
			{
				break;
			}
		}
		st[stn] = i;
		stn++;
	}
	for(int i = (1 << (DEEP - 1)) - 2; i >= 0; i--)
	{
		seg[i] = max(seg[i * 2 + 1],seg[i * 2 + 2]);
	}
	long long int all = 0;
	long long int nh = h;
	for(int i = 0; i < n - 1; i++)
	{
		long long int nt = tai[nextk[i]] - tai[i] + 1;
		long long int tari = nt - nh;
		if(tari <= 0)
		{
			i = nextk[i] - 1;
			nh -= (nt - 1);
			continue;
		}
		long long int kaikai = (tari - 1) / kai[i] + 1;
		long long int kaiw = kaikai * kai[i];
		if(kaiw + nh > h)
		{
			long long int na = h - nh;
			long long int cank = na / kai[i];
			long long int ak = h - (cank * kai[i] + nh);
			int now = i;
			int han = n - i;
			for(int j = 0; j < 20; j++)
			{
				if(tai[now + han] - tai[i] + 1 <= cank * kai[i] + nh)
				{
					now += han;
				}
				han = (han + 1) / 2;
			}
			long long int maxw = segmax(i + 1,now);
			if(maxw < ak)
			{
				all += cank + 1;
				nh = h - tai[i + 1] + tai[i];
			}
			else
			{
				all += cank;
				nh = nh + cank * kai[i] - tai[i + 1] + tai[i];
			}
		}
		else
		{
			i = nextk[i] - 1;
			nh = nh + kaiw - (nt - 1);
			all += kaikai;
		}
	}
	printf("%lld\n",all);
	return 0;
}