#Z14117. 药房管理

药房管理

Description

With the rapid development of information technology, medical informatization has become an essential part of hospital construction. Computers can effectively assist hospitals in managing vast amounts of data, such as doctor information, patient information, and medication records, freeing staff from these mechanical tasks and allowing them to focus more on actual medical processes. This significantly improves the overall efficiency of the hospital.

The management of medications is one of the critical aspects. Now, the pharmacy administrator wishes to use a computer to assist in this management. Assume that for any given medication, the total inventory at the start of the day is known, and no additional stock is added during the day. Throughout the day, many patients will come to collect their medications, each requesting different quantities. If a patient's requested amount exceeds the current inventory, the pharmacy will deny the request.

The administrator wants to know how many patients fail to collect their medications each day.

Input Format

The input consists of 3 lines:

  • The first line contains the total medication inventory m at the start of the day.
  • The second line contains the number of patients n (0 < n ≤ 100) visiting that day.
  • The third line contains n numbers, representing the quantities of medication each patient requests (in chronological order).

Output Format

Only 1 line, indicating the number of patients who failed to collect their medications that day.

30
6
10 5 20 6 7 8

2