Time on Task

No attempts yetTime limit1sMemory limit128 MB

Problem

A parent has asked you to do your chores.

Each chore takes a certain amount of time, and you can only do one chore at a time. The time you are given may not be enough to finish every chore. You may do the chores in any order you like.

Determine the largest number of chores you can finish within the given amount of time.

Input

The first line contains an integer $T$ ($0 \le T \le 100000$), the total number of minutes you have available for your chores.

The second line contains an integer $C$ ($0 \le C \le 100$), the number of chores you may choose from. Each of the next $C$ lines contains a positive integer: the number of minutes needed for that chore. Each chore takes at most $100000$ minutes.

Output

Output the maximum number of chores that can be finished within the time limit $T$.

Hint

For example, suppose the time limit is $6$ minutes and there are $3$ chores taking $3$, $6$, and $3$ minutes. The answer is $2$, because only two chores (the first and the third) can be finished within $6$ minutes, and it is impossible to finish all three.