eolymp
bolt
Try our new interface for solving problems
Problems

Sum of negative

Sum of negative

Find the sum of negative integers in the given array. \InputFile The first line contains the number $n$. The second line contains $n$ integers, each no more than $100$ by absolute value. \OutputFile Print the sum of negative integers in the array. If there is no negative integers in array, print $0$.
Time limit 1 second
Memory limit 128 MiB
Input example #1
5
-5 6 8 -3 0
Output example #1
-8
Author Michael Medvedev