Problem1533--Bus passengers

1533: Bus passengers

[Creator : ]
Time Limit : 1 sec  Memory Limit : 128 MB

Description

    At the beginning, there are N passengers on the bus. It will then pass through M platforms. Each platform will have Ai passengers getting off and Bi passengers boarding. Ask how many passengers are on the bus after M platforms?

Input

The first line has two numbers: N, M.

Next there are M rows of two integers: Ai, Bi.

Output

An integers, the number of passengers in the car.

Sample Input Copy

10 3
5 4
7 9
0 2

Sample Output Copy

13

Source/Category