
# import time
# t0 = time.time()
# print(0)

n,h= map(int,input().split())
a = [input().rstrip().split() for i in range(0,n)]

# n = 2
# h = 10
a2 = [[0 for i in range(2)] for j in range(2*n)]
# a=[['3', '5'], ['2', '6']]
for i in range(0,n):
    a2[2*i][0]=int(a[i][0])
    a2[2*i+1][0]=int(a[i][1])
    a2[2*i+1][1]+=1
# a2
# t1 = time.time()
# print('生成完了',t1-t0)
a2=sorted(a2,reverse=True)

# t2 = time.time()

# print('ソート完了',t2-t1)
# a2
cnt = 0
c = 0
while(1):
    if h<= 0:
        break
    if a2[c][1]==1:
        h = h-a2[c][0]
        c += 1
        cnt += 1
    elif(a2[c][1]==0):
        h = h-a2[c][0]
        cnt += 1
# t3 = time.time()
# print('カウント完了',t3-t2)
print(cnt)
