import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class Main {
static class status{
public status(int[] map, int value) {
super();
this.map = new int[3];
for(int i=0;i<map.length;i++){
this.map[i]=map[i];
}
this.value = value;
}
public status(status tmp) {
this.map = new int[3];
for(int i=0;i<map.length;i++){
this.map[i]=tmp.map[i];
}
this.value = tmp.value;
}
int map[];
int value;
}
static int a[] = new int[3];
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
a[0] = in.nextInt();
a[1] = in.nextInt();
a[2] = in.nextInt();
Queue<status> q = new LinkedList<status>();
for(int i=0;i<3;i++){
int map[] = new int[3];
map[i]=1;
status tmp = new status(map,0);
tmp.value = a[i];
q.add(tmp);
}
int max = Integer.MIN_VALUE;
while(!q.isEmpty()){
status tmp = q.remove();
if (max<tmp.value){
max = tmp.value;
}
status mu1 = new status(tmp);
if(muti(q,mu1)){
}
status ad1 = new status(tmp);
if(add(q,ad1)){
}
if (max<ad1.value){
max = ad1.value;
}
if (max<mu1.value){
max = mu1.value;
}
}
System.out.println(max);
}
private static boolean muti(Queue<status> q, status tt) {
for(int i=0;i<3;i++){
status tmp = new status(tt);
if(tmp.map[i]!=1){
tmp.map[i]=1;
tmp.value = tmp.value*a[i];
q.add(tmp);
}
}
return false;
}
private static boolean add(Queue<status> q,status tt) {
for(int i=0;i<3;i++){
status tmp = new status(tt);
if(tmp.map[i]!=1){
tmp.map[i]=1;
tmp.value = tmp.value+a[i];
q.add(tmp);
}
}
return false;
}
}