P12193 [AOJ] Receipt
普及
题目描述

problem

Taro bought 10 books. Later, I tried to find out the price based on the receipt, but the receipt was dirty and I could not read the price of a book. We decided to calculate the price of the book from the total price of 10 books and the prices of the other 9 books.

Write a program that outputs the price of the book whose price could not be read. The prices of books are all positive integers. Also, there is no need to consider the consumption tax.

Example

Input

9850
1050
800
420
380
600
820
2400
1800
980
0

Output

600

输入格式

见题面

输出格式

见题面

样例输入
9850 1050 800 420 380 600 820 2400 1800 980 0
样例输出
600