#t495. 药房管理
药房管理
Pharmacy Management
Problem Description
With the booming development of information technology, medical informatization has become an indispensable part of hospital construction. Computers can greatly help hospitals manage massive data such as doctors' information, patients' information and drug information, freeing staff from mechanical work so they can devote more energy to the actual medical process and greatly improving the hospital's overall efficiency.
Managing medications is an important part of this work. The pharmacy manager now wants to use a computer to help him. Suppose that for any given drug, the total stock at the start of the day is known, and the stock is never increased through restocking during the day. Every day many patients come to collect medicine, and each patient wants to take away a different amount. If the amount a patient needs exceeds the current stock, the pharmacy refuses that patient's request. The manager wants to know how many patients each day fail to get their medicine.
Input Format
There are 3 lines in total.
The first line is the total amount of the drug at the start of the day, ;
The second line is the number of people collecting medicine that day, ;
The third line contains numbers recording, in chronological order, the amount of medicine each patient wants to take away; the numbers are separated by spaces.
Output Format
One line: the number of patients who did not get their medicine that day.
Sample Input
30
6
10 5 20 6 7 8
Sample Output
2