import java.io.; public class Main { public static void main(String[] args) throws IOException{ BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String[] in = bf.readLine().split(" "); int a = Integer.parseInt(in[0]); int b = Integer.parseInt(in[1]); int c = Integer.parseInt(in[2]); int maxn = Math.max((b+c)a,Math.max(abc,(a+b)*c)); System.out.println(maxn); } }