GPA

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

In this semester, Alice took nn courses. Now, she has finished all the final exams. And she will get her grades in the following nn days.

On the ii-th day, Alice will know her grade A_iA\_i of the ii-th course. If A_iA\_i is strictly less than the average grade of the first i1i - 1 courses, Alice will be sad on that day.

Now Bob is hacking into the university's database. Bob can choose a set SS of courses (SS can be empty). And then for each course ii in SS, he can change Alice's grade from A_iA\_i to B_iB\_i.

Bob wants to minimize the number of days when Alice will be sad. Now you need to help him to decide which courses' grades he should modify.

Note that Alice will always be happy on the first day.

입력

The first line contains a single integer nn (1n40001 \le n \le 4000).

Then nn lines follow. The ii-th of these lines contains two integers, A_iA\_i and B_iB\_i (0A_i,B_i4000 \le A\_i, B\_i \le 400).

출력

Output the minimum number of days when Alice will be sad.