#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
while (cin >> n) {
long long sum = 0;
for (int i = 0; i < n; ++i) {
long long a;
cin >> a;
if (a < 0) {
sum += -a;
}
}
cout << sum << endl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long n, x, s = 0;
while (cin >> n)
{
s = 0;
for (int i = 1; i <= n; i++)
{
cin >> x;
if (x < 0) s -= x;
}
cout << s << endl;
}
return 0;
}
1
[2026 January TFOJ Easy Round] Supermarket Promotion 1