Programming olympiad
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
There are n participants arrived to ACM competition. As a result of the survey, the jury found that a participants code in C, b in Python, c in Pascal, x simultaneously know C and Python, y - Python and Pascal, z - C and Pascal. Given the values n, a, b, c, x, y, z, find the number of participants who program in three programming languages.
Input
The first line contains seven integers n, a, b, c, x, y, z, the values do not exceed 100.
Output
Print the number of participants who write the code in three programming languages.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 33%