Data Plan

Track monthly data allowance that rolls over, subtract each month's usage, and report the megabytes available in month N+1.

Easy2ImplementationMathInterviewNo attempts yetTime limit1sMemory limit64 MB

Problem

Pero signed a data plan with his internet provider. The provider lets Pero use up to XX megabytes of internet per month. Every megabyte he does not spend during a month carries over to the next month and can still be spent. Pero can never spend more megabytes than he has left.

Given how many megabytes Pero spent in each of the first NN months on the plan, find how many megabytes Pero has available in month N+1N + 1.

Input

The first line contains the integer XX (1X1001 \le X \le 100).

The second line contains the integer NN (1N1001 \le N \le 100).

Each of the next NN lines contains an integer PiP_i (0Pi100000 \le P_i \le 10000), the number of megabytes spent in month ii on the plan. The input never makes Pero spend more megabytes than he has left.

Output

Print the number of megabytes Pero has available in month N+1N + 1.