#include <bits/stdc++.h>
using namespace std;
int main() {
  int a1, b, c;
  scanf("%d", &a1);
  scanf("%d", &b);
  scanf("%d", &c);
  int a[6];
  a[0] = a1 + b + c;
  a[1] = a1 * b * c;
  a[2] = a1 * (b + c);
  a[3] = a1 * b + c;
  a[4] = a1 + b * c;
  a[5] = (a1 + b) * c;
  sort(a, a + 6);
  printf("%d\n", a[5]);
  return 0;
}
