Canoes

No attempts yetTime limit1sMemory limit128 MB

Problem

You are organizing a canoe tour. Canoes can be hired at the harbour, and all of them are identical. A single canoe holds at most two people, and the combined weight of the people in it cannot exceed a fixed maximum. To keep the cost as low as possible, you must seat every participant using as few canoes as possible.

Write a program that:

  • reads the maximum weight a canoe crew may have, the number of participants, and the weight of each participant from standard input,
  • computes the minimum number of canoes needed to seat every participant under these rules,
  • writes that result to standard output.

Input

The first line contains one integer ww, the maximum weight of a canoe crew (80w20080 \le w \le 200). The second line contains one integer nn, the number of participants (1n300001 \le n \le 30000).

Each of the next nn lines contains one integer, the weight of a participant, which is between 55 and ww inclusive.

Output

Print a single integer on the first line: the minimum number of canoes that must be hired.