Gym Badges
문제
In a quest to be the very best, you have decided to set out on your journey around the region to prove your strength by collecting gym badges. You begin your solo adventure with your first and only Pokemon, which happens to be a legendary Wabbit.
Your Wabbit starts at level and can only gain levels by challenging gyms. There are gyms numbered from to spread across the region and you can challenge them in any order. To prevent over grinding, gym has its own level cap where you can only challenge the gym if Wabbit’s current level is less than or equal to .
As there may be different number of trainers to defeat in a gym, the number of levels that Wabbit gains after challenging a gym may differ. To be precise, Wabbit will gain levels after challenging gym .
Each gym rewards successful challengers with their own unique gym badge . Find the maximum number of unique gym badges that you can obtain if you challenge the gyms in an optimal way.
입력
Your program must read from standard input.
The first line contains an integer , the number of gyms.
The second line contains integers, where the th integer represents the level Wabbit gains by challenging th gym, .
The third line contains integers, where the th integer represents the level cap of the th gym, .
출력
Your program must print to standard output.
The output should contain a single integer on a single line, the maximum number of unique gyms badges that can be won.
예제
예제 1
5 4 6 3 5 2 10 6 4 8 12
4
예제 2
5 3 9 4 2 6 10 10 10 10 10
4