from itertools import combinations
N = int(input())
expression = input()
indexes = []
for i in range(1,((N-(N//2))//2)+1):
    indexes.extend(combinations([x*2 for x in range(0,(N//2))],i))

def cal(x, op, y):
    if op=='+':
        return int(x)+int(y)
    elif op=='*':
        return int(x)*int(y)
    else:
        return int(x)-int(y)

if N==1:
    answer = int(expression[0])
elif N==3:
    answer = cal(expression[0],expression[1],expression[2])
else:
    answer = -(2**31)

for index in indexes:
    temp = 0
    bp=True
    for i in index:
        if temp-2 ==i:
            bp=False
        temp=i
    if bp:
        start=int(expression[0])
        i = 0
        while i!=N-1:
            if i+2 in index:               
                start = cal(start,expression[i+1],cal(expression[i+2],expression[i+3],expression[i+4])) 
                i += 4
            else:
                start = cal(start,expression[i+1],expression[i+2])
                i += 2
        if start>answer:
            answer = start
print(answer)

'''
dp = [0]*((len(expression)//2)+1)
for i in range(0,(len(expression)//2)+1):
    if i ==0:
        dp[0]=int(expression[0])
    elif i==1:
        dp[1]=cal(dp[0],expression[1],int(expression[2]))
    else:
        dp[i]=max(cal(dp[i-1],expression[(i*2)-1], int(expression[i*2])) ,cal(dp[i-2],expression[((i-2)*2)+1],cal(int(expression[(i-1)*2]), expression[((i-1)*2)+1], int(expression[i*2]))))  
print(dp[-1])
'''
#음수를 곱했을 때 커지는 경우를 고려해야하므로 DP풀이는 시간적으로 의미가 없어진다.
# 19
# 2*1-1*1+2*2-9*8-9*9