Compose a polygon#2096

Compose a polygon

4 seconds
64 megabytes
Very easy

Given a set of line segments, determine the minimum number of segments that must be removed so that the remaining segments can form a polygon with non-zero area.

Input

The first line contains an integer (3 \leq n \leq 50), the number of segments in the set. The second line contains integers: the lengths of the segments. Each length is between and 10^6 inclusive.

Output

Output the minimum number of segments that need to be removed so that the remaining segments can form a polygon. If it is not possible to form a polygon from any subset of the segments, output -1.

Examples

Example 1

Loading
Loading