Vasya has long dreamed of winning the Olympiad in Informatics. It has only three weaknesses: loops, arrays, and strings. Before today's tournament, Vasya did intensive training, during which he solved A problems for cycles, B problems for arrays and C problems for strings. Subsequently, it turned out that of the solved problems D were both for cycles and for arrays, E – into cycles and into lines, F – for strings and arrays. And there were even G tasks that included loops, strings, and arrays. Help Vasya calculate how many different problems he has solved in total.
Input
The numbers A, B, C, D, E, F, and G are entered, separated by spaces.
In all test cases, all input data is correct and does not exceed 1,000. Numbers can be equal to zero.
Imprint
Print one number – the number of tasks solved by Vasya.
Examples
# |
Input |
Output |
1 |
0 0 0 0 0 0 0 |
0 |
2 |
1 1 1 0 0 0 0 |
3 |
3 |
1 1 1 1 1 1 1 |
1 |