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 String s,t;
	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];
	}
	public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);//new File("input.txt"));
	    PrintWriter pw = new PrintWriter(System.out);//new File("output.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();
	}
}
