#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstring>
#include <deque>
#include <time.h>
#include <stack>
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#include <fstream>
#include <queue>
#define mp make_pair
#define pb push_back
#define PI 3.14159265358979323846
#define MOD 1000000007
#define INF ((ll)1e+15)
#define x1 fldgjdflgjhrthrl
#define x2 fldgjdflgrtyrtyjl
#define y1 fldggfhfghjdflgjl
#define y2 ffgfldgjdflgjl
typedef long long ll;
using namespace std;
ll i,j,n,x,y,m,k,ans,a[6000],b[6000];
vector <ll> f;
string s,t;
pair<ll,ll> solve(ll l, ll r)
{
ll x = 0, y = a[l];
for (int i = l; i < r; i++)
if (b[i] == 1)
x += y, y = a[i+1];
else
y *= a[i+1];
return mp(x,y);
}
int main()
{
cin >> s;
t = "1*";
t.append(s);
t.append("*1");
s = t;
n = s.size();
m = n/2;
for (i = 0; i < n; i+=2)
a[i/2] = s[i] - '0';
for (i = 1; i < n; i+=2)
if (s[i] == '+')
b[i/2] = 1;
else
{
b[i/2] = 2;
f.push_back(i/2);
}
ll max1 = 0;
for (i = 0; i < f.size(); i++)
for (j = i+1; j < f.size(); j++)
{
pair <ll,ll> tmp = solve(0,f[i]);
x = tmp.first, y = tmp.second;
tmp = solve(f[i]+1,f[j]);
y *= tmp.first + tmp.second;
ll xx = a[f[j]];
a[f[j]] = y;
tmp = solve(f[j],m);
max1 = max(max1, x+tmp.first+tmp.second);
a[f[j]] = xx;
}
cout << max1 << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDx2ZWN0b3I+CiNpbmNsdWRlIDxjc3RyaW5nPgojaW5jbHVkZSA8ZGVxdWU+CiNpbmNsdWRlIDx0aW1lLmg+CiNpbmNsdWRlIDxzdGFjaz4KI2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXA+CiNpbmNsdW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