n = int(input()) k = map(int, input().split()) k = [abs(i) for i in k if i < 0] print(sum(k))