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
sign = 0
for x in a[i:]:
    sign ^= x < 0
if sign == 0:
    for x in a[i:]:
        if x in [0,1]:
            ans += x
        else:
            ans *= x
else:
    mx = -10 ** 9
    for x in a[i:]:
        if x < 0:
            mx = max(mx,x)
    for x in a[i:]:
        if x in [0,1]:
            ans += x
        elif x == mx:
            ans -= x
            mx = 0
        else:
            ans *= x
print(ans)