AUCSE012 - Student Proxy

A Proxy in context of class attendance refers to the act when a student who is present in a class makes attendance for a student who is absent in the same class.

There are N students in a class.

All the students have different expertise in giving proxies.

Precisely, we associate an integer P with every student which denotes the number of proxies he can make. 

All students are capable of making proxies for any other student.

Input

First line contains an integer N (1 <= N <= 1000000) denoting the total number of students.

Then, N lines follow each containing an integer Ai (1 <= Ai <= 100). The integer Ai on the ith line denotes the number of proxies that the ith student can make.

Output

Print the minimum number of students that can be present in the class such that by giving proxies the recorded attendance can be 100%.

Example

Input:
5
1
3
2
1
2

Output:
2

Explanation, one possible solution is that the first and second student are present. Now first student can give 1 proxy and second can give 2 proxies making the recorded attendance 5.


Added by:amit karmakar
Date:2011-08-06
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All

hide comments
2012-04-14 10:22:39 Francky
There is some Ai equal to 0.
It cost me some WA !!!
It's a real challenge in Python, reading in time is hard !
2012-04-14 10:22:39 Nitin Sharma
should be moved to tutorial !!
2012-04-14 10:22:39 Suraj D
tutorial for sure!!


Last edit: 2012-04-10 12:13:32
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.