#0004BC

O-Mnogougao

Kaja, Ines and Milena practice geometry. They have to create one convex polygon with as much sides as possible from set of N segments.


Image: mnogougao

InputIn first line of standard input is one natural number N (1 <= N <= 5000 ), number of segments.
In next N lines are one integer one each line Di (1 <= Di <= 1000000) length of i-th segment.

OutputIn one and only row of standard output write maximal number of segments they can use for creating single polygon.
If is not possible to create at least triangle, write 0.

Example 1:

Input:

5
1
4
10
4
1

Output:

4



Example 2:

Input:

3
1
4
3

Output:

0


Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.