屠屠小队

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

终于占领了人类的老巢,接下来土拨鼠们要组成屠屠小队,抢走他们的女人,瓜分他们的财产。

Description

为了更好的组队搭配,我们采取以下方案组队。

每只土拨鼠都有一个饥渴值aia_i,如果要组成一个小队,要求屠屠小队的人数要大于等于队伍中的每一个aia_i

给你nn个土拨鼠, 问你最多能组成多少个屠屠小队,允许有土拨鼠无法组队抢女人。

Format

Input

第1行一个正整数nn,表示一共有nn只土拨鼠要组队。

第2行有nn个正整数,表示每只土拨鼠的饥渴程度aia_i

Output

输出一个整数,表示最多能组成多少个屠屠小队

Samples

3
1 2 2
2

样例解释1

{1},{2,3}可组成两队

5
1 2 3 4 5
1

样例解释2

有五种情况, 但是每种情况都只能组成一队, 其余的土拨鼠无法再次组队。

{1}, {1,2}, {1,2,3}, {1,2,3,4}, {1,2,3,4,5}

Limitation

1s, 1024KiB for each test case.

1n21051 \le n \le 2*10^5

1ain1 \le a_i \le n

非常好看

Not Attended
Status
Done
Rule
Ledo
Problem
40
Start at
2025-1-24 16:45
End at
2025-4-18 0:45
Duration
2000 hour(s)
Host
Partic.
17