n = int(input()) a = list(map(int,input().split(' '))) i = 0 while i < n and a[i] == 0: i += 1 if i == n: print(0) exit(0) ans = abs(a[i]) i += 1 for x in a[i:]: if abs(x) <= 1: ans += abs(x) else: ans *= abs(x) print(ans)