def main(): N = int(input()) a = list(map(int, input().split())) i = 0 b = [] ans = 0 while i < N: if a[i] == 0 or a[i] == 1: ans = eval(str(ans) + '+' + str(a[i])) elif a[i] < 0: ans = eval(str(ans) + '-' + str(a[i])) else: ans = eval(str(ans) + '*' + str(a[i])) i += 1 print(ans) main()