Woburn Challenge 2015-16 Round 2 - Junior Division

As part of his intensive Jedi training at the hands of Master Yoda in the Dagobah system, Luke has been given the task of moving some rocks. That may sound simple, but he'll have to move them with his mind, using the power of the Force! Also, some of the rocks are rather heavy.
Yoda has laid out
Assuming that Luke tries his best and moves as many of the rocks as he can, what's the total mass of the rocks that he'll lift?
Input Specification
The first line of input consists of two space-separated integers
The next
Output Specification
Output a single integer – the total mass of rocks that Luke can lift with the force.
Sample Input
6 8
4
9
8
12
7
1
Sample Output
20
Sample Explanation
The
Comments