Vanya is doing his maths homework. He has an expression of form <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/12fd75e59feeb788ff8b791f7194301b0d005ad6.png" style="max-width: 100.0%;max-height: 100.0%;"/>, where *x*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, ..., *x*<sub class="lower-index">*n*</sub> are digits from 1 to 9, and sign <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/5535bcdec4c47f48bc7dcaaf51ba2b5901a202e5.png" style="max-width: 100.0%;max-height: 100.0%;"/> represents either a plus '+' or the multiplication sign '*'. Vanya needs to add one pair of brackets in this expression so that to maximize the value of the resulting expression.
The first line contains expression *s* (1 ≤ |*s*| ≤ 5001, |*s*| is odd), its odd positions only contain digits from 1 to 9, and even positions only contain signs  +  and  * . 

The number of signs  *  doesn't exceed 15.
import sys, os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

s = list(input().rstrip())
n = len(s) // 2 + 1
u, v = [], []
for i in range(0, len(s), 2):
    u.append(s[i] - 48)
for i in range(1, len(s), 2):
    v.append(s[i] & 1)
dpl = [0] * n
dpl[0] = u[0] if v[0] else 0
st = [u[0]]
for i in range(1, n):
    if v[i - 1] & 1:
        st.append(u[i])
    else:
        st[-1] *= u[i]
    if len(st) == 3:
        st[0] += st[1]
        st[1] = st.pop()
    dpl[i] = sum(st) if i == n - 1 or v[i] else dpl[i - 1]
u.reverse()
v.reverse()
dpr = [0] * n
dpr[0] = u[0] if v[0] else 0
st = [u[0]]
for i in range(1, n):
    if v[i - 1] & 1:
        st.append(u[i])
    else:
        st[-1] *= u[i]
    if len(st) == 3:
        st[0] += st[1]
        st[1] = st.pop()
    dpr[i] = sum(st) if i == n - 1 or v[i] else dpr[i - 1]
u.reverse()
v.reverse()
dpr.reverse()
dpl, dpr = [0] + dpl, dpr + [0]
ans = 0
for i in range(n):
    st = [u[i]]
    for j in range(i + 1, n):
        if v[j - 1] & 1:
            st.append(u[j])
        else:
            st[-1] *= u[j]
        if len(st) == 3:
            st[0] += st[1]
            st[1] = st.pop()
        s = sum(st)
        l, r = i - 1, j
        while l >= 0 and not v[l]:
            s *= u[l]
            l -= 1
        while r < n - 1 and not v[r]:
            s *= u[r + 1]
            r += 1
        ans = max(ans, s + dpl[i] + dpr[j + 1])
print(ans)