eolymp
bolt
Try our new interface for solving problems

114

Time limit 1 second
Memory limit 64 MiB

114

Examples

Input example #1
7
-1
4
-6
0
Output example #1
-2
Input example #2
-14
-4
12
-19
13
14
20
-12
19
19
11
-9
19
-3
-4
17
20
0
Output example #2
32