import java.util.* ;
import java.io.* ;
import java.math.* ;
class Main {
static long a[ ] = new long [ 6000 ] ;
static long b[ ] = new long [ 6000 ] ;
static long xx,yy,x,y,k,ans;
static int i,j,m,n;
static void solve( int l, int r)
{
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 ] ;
}
Scanner sc
= new Scanner
( System .
in ) ; //new File("input.txt")); s = sc.next ( ) ;
t = "1*" ;
t = t.concat ( s) ;
t = t.concat ( "*1" ) ;
s = t;
n = s.length ( ) ;
m = n/ 2 ;
for ( i = 0 ; i < n; i+= 2 )
a[ i/ 2 ] = ( int ) s.charAt ( i) - ( int ) '0' ;
for ( i = 1 ; i < n; i+= 2 )
if ( s.charAt ( i) == '+' )
b[ i/ 2 ] = 1 ;
else
b[ i/ 2 ] = 2 ;
long max1 = 0 ;
for ( i = 0 ; i < m; i++ )
for ( j = i+ 1 ; j < m; j++ )
if ( b[ i] == 2 && b[ j] == 2 )
{
solve( 0 ,i) ;
xx = x; yy = y;
solve( i+ 1 ,j) ;
yy *= x + y;
long xxx = a[ j] ;
a[ j] = yy;
solve( j,m) ;
max1
= Math .
max ( max1, xx
+ x
+ y
) ; a[ j] = xxx;
}
pw.println ( max1) ;
pw.close ( ) ;
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5pby4qOwppbXBvcnQgamF2YS5tYXRoLio7CgpjbGFzcyBNYWluIHsKCXN0YXRpYyBsb25nIGFbXSA9IG5ldyBsb25nWzYwMDBdOwoJc3RhdGljIGxvbmcgYltdID0gbmV3IGxvbmdbNjAwMF07CglzdGF0aWMgbG9uZyB4eCx5eSx4LHksayxhbnM7CglzdGF0aWMgaW50IGksaixtLG47CglzdGF0aWMgU3RyaW5nIHMsdDsKCXN0YXRpYyB2b2lkIHNvbHZlKGludCBsLCBpbnQgcikKCXsKCQl4ID0gMDsgeSA9IGFbbF07CgkJZm9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