One tradition of ACM-ICPC contests is that a team gets a balloon for every solved problem. We assume that the submission time doesn't matter and teams are sorted only by the number of balloons they have. It means that one's place is equal to the number of teams with more balloons, increased by 1. For example, if there are seven teams with more balloons, you get the eight place. Ties are allowed.

You should know that it's important to eat before a contest. If the number of balloons of a team is greater than the weight of this team, the team starts to float in the air together with their workstation. They eventually touch the ceiling, what is strictly forbidden by the rules. The team is then disqualified and isn't considered in the standings.

A contest has just finished. There are n teams, numbered 1 through n. The i-th team has t_{i} balloons and weight w_{i}. It's guaranteed that t_{i} doesn't exceed w_{i} so nobody floats initially.

Limak is a member of the first team. He doesn't like cheating and he would never steal balloons from other teams. Instead, he can give his balloons away to other teams, possibly making them float. Limak can give away zero or more balloons of his team. Obviously, he can't give away more balloons than his team initially has.

What is the best place Limak can get?


-----Input-----

The first line of the standard input contains one integer n (2 ≤ n ≤ 300 000) — the number of teams.

The i-th of n following lines contains two integers t_{i} and w_{i} (0 ≤ t_{i} ≤ w_{i} ≤ 10^18) — respectively the number of balloons and the weight of the i-th team. Limak is a member of the first team.


-----Output-----

Print one integer denoting the best place Limak can get.


-----Examples-----
Input
8
20 1000
32 37
40 1000
45 50
16 16
16 16
14 1000
2 1000

Output
3

Input
7
4 4
4 4
4 4
4 4
4 4
4 4
5 5

Output
2

Input
7
14000000003 1000000000000000000
81000000000 88000000000
5000000000 7000000000
15000000000 39000000000
46000000000 51000000000
0 1000000000
0 0

Output
2



-----Note-----

In the first sample, Limak has 20 balloons initially. There are three teams with more balloons (32, 40 and 45 balloons), so Limak has the fourth place initially. One optimal strategy is: Limak gives 6 balloons away to a team with 32 balloons and weight 37, which is just enough to make them fly. Unfortunately, Limak has only 14 balloons now and he would get the fifth place. Limak gives 6 balloons away to a team with 45 balloons. Now they have 51 balloons and weight 50 so they fly and get disqualified. Limak gives 1 balloon to each of two teams with 16 balloons initially. Limak has 20 - 6 - 6 - 1 - 1 = 6 balloons. There are three other teams left and their numbers of balloons are 40, 14 and 2. Limak gets the third place because there are two teams with more balloons. 

In the second sample, Limak has the second place and he can't improve it.

In the third sample, Limak has just enough balloons to get rid of teams 2, 3 and 5 (the teams with 81 000 000 000, 5 000 000 000 and 46 000 000 000 balloons respectively). With zero balloons left, he will get the second place (ex-aequo with team 6 and team 7).

Difficulty: interview

Starter code:

Solutions:
from bisect import bisect_right
import heapq

n = int(input())
l = []

ti, wi = list(map(int, input().split()))
bal = ti
pos = 1
for _ in range(n - 1):
    ti, wi = list(map(int, input().split()))
    if ti > bal:
        pos += 1
    l.append((ti, wi - ti + 1))
l.sort()

best_pos = pos

op = bisect_right(l, (bal, float('inf')))
#print(l)

w = []
for i, v in l[op:]:
    heapq.heappush(w, v)
op -= 1

while w:
    head = heapq.heappop(w)
    if bal < head:
        break
    bal -= head
    pos -= 1

    #print(w, op)
    while op >= 0 and l[op][0] > bal:
        heapq.heappush(w, l[op][1])
        op -= 1
        pos += 1
    best_pos = min(best_pos, pos)

print(best_pos)


'''input
8
20 1000
32 37
40 1000
45 50
16 16
16 16
14 1000
2 1000
'''
import heapq
from bisect import bisect

inf = 10**18 + 2

def rints():
    return list(map(int, input().split()))

def ri():
    return int(input())

def bin_search(arr, pred, lo=0, hi = None):
    if hi is None:
        hi = len(arr)
    while lo < hi :
        mid = (lo+hi) // 2
        if pred(arr[mid]):
            hi = mid
        else:
            lo = mid + 1
    return lo

n = ri()
score, _ = rints()

teams = []
for _ in range(n-1):
    t, w = rints()
    teams.append((w-t + 1, t, w))

teams.sort(key = lambda x : x[1])
# print(teams)

def solve(score):
    idx = bin_search(teams, lambda x : x[1] > score)
    best = pos = len(teams) - idx + 1
    # print(teams[idx:], pos)

    ahead = teams[idx:]
    behind = teams[:idx]
    heapq.heapify(ahead)
    # print(ahead)

    while ahead and score >= ahead[0][0]:
        score -= heapq.heappop(ahead)[0]
        pos -= 1
        while behind and behind[-1][1] > score:
            heapq.heappush(ahead, behind.pop())
            pos += 1
        # print(score, pos)
        best = min(best, pos)

    return best

print(solve(score))



import heapq

n = int(input())

num_balloons = int(input().split()[0])
better_teams = []
current_place = 1
worse_teams = []
for i in range(1, n):
    inp = input().split()
    team_balloons = int(inp[0])
    team_size = int(inp[1])
    if team_balloons>num_balloons:
        current_place+=1
        better_teams.append(team_size-team_balloons+1)
    else:
        worse_teams.append([team_balloons, team_size])

heapq.heapify(better_teams)
best_place = current_place
worse_teams = sorted(worse_teams,key=lambda x:-x[0])
ind = 0

while True:
    if len(better_teams)==0:
        break
    removed_team = heapq.heappop(better_teams)
    num_balloons -= removed_team
    current_place-=1
    if num_balloons<0:
        break
    while ind<len(worse_teams) and worse_teams[ind][0]>num_balloons:
        heapq.heappush(better_teams,worse_teams[ind][1]-worse_teams[ind][0]+1)
        current_place+=1
        ind+=1
    if current_place<best_place:
        best_place=current_place

print(best_place)

import sys
input = sys.stdin.readline
from heapq import heappop, heappush, heapify

n = int(input())
b, _ = list(map(int, input().split()))
heap = []
heap2 = []
for _ in range(n-1):
    t, w = list(map(int, input().split()))
    if t > b:
        heap.append(w + 1 - t)
    else:
        heap2.append((-t, -w))
heapify(heap)
heapify(heap2)
ans = len(heap) + 1
while heap:
    need = heap[0]
    if need > b:
        break
    b -= need
    heappop(heap)
    while heap2 and -heap2[0][0] > b:
        t, w = heappop(heap2)
        t, w = -t, -w
        heappush(heap, w + 1 - t)
    cur = len(heap) + 1
    ans = min(ans, cur)
print(ans)