#include <bits/stdc++.h>
int main() {
  int a, b, c;
  int d;
  scanf("%d%d%d", &a, &b, &c);
  d = a + b + c;
  d = (d > (a + b) * c) ? d : (a + b) * c;
  d = (d > a + (b * c)) ? d : a + (b * c);
  d = (d > a * (b + c)) ? d : a * (b + c);
  d = (d > a * b * c) ? d : a * b * c;
  printf("%d\n", d);
}
