#Lutece1839. 模拟题

模拟题

Migrated from Lutece 1839 模拟题

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

FJ和他的奶牛在玩牌,总共2N张牌,点数从1到2N。它们各自分得N张牌,游戏一共进行N轮,每轮各自出一张牌(一张牌只能出一次),点数大的赢得该轮。奶牛由于智商有限,它告诉FJ它会按点数从大到小的顺序出牌。现在,FJ想知道他最多能赢几轮。

Input

第一行为整数N(1<=N<=50000)。 接下来N行每行一个整数,即奶牛分得的N张牌。

Output

输出一个整数,即FJ最多能赢的轮数。

Samples

3
1
6
4
2

Resources

USACO