There are n aspiring politicians in Neverland. They are wealthy, but not wealthy enough to gain political influence. Since Neverland is a financially transparent haven, we know the bank statements of each politician: the i-th politician (1 ≤ i ≤ n) has
mi dollars, and needs
pi more dollars to achieve his political goals.
You are the infamous modern superhero Neo-Robin Hood. You earn your living by stealing from the rich and wealthy, in order to help... well, whoever promises to help you back. For each of the n politicians you can chose to do one of the following:
- Steal his
- Do nothing to him;
- Help him gain political influence, by giving him
But your services don’t come for free. Once you help a politician gain political influence, he is bound to help you cover-up one of your thefts so that you won’t get in trouble – for instance, by providing an alibi. In turn, you are also bound to not steal his money in the future.
Initially you start with no money. Your task is to rob as many politicians as possible; however, you can’t afford to get caught, so you need a politician to account for each crime you commit.
What is the maximum number of people you can rob?
The first line contains a positive integer n (1 ≤ n ≤ 100 000), the number of politicians. The second line contains n positive integers
mi (1 ≤
109, for all 1 ≤ i ≤ n). The third line contains n positive integers
pi (1 ≤
109, for all 1 ≤ i ≤ n).
Output a single non-negative integer, the maximum number of people that you can steal from.
Note that you do not have to maximize your own wealth, but rather the number of people that you are stealing from.
5 2 3 4 5 6 1 2 3 4 5
4 1 2 4 2 5 6 9 7
4 9 19 6 5 20 3 16 19