#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, f = INT_MAX;
  scanf("%d %d %d", &a, &b, &c);
  f = max(a + b + c, a * b * c);
  f = max(f, a * (b + c));
  f = max(f, (a + b) * c);
  printf("%d\n", f);
}
