#include <bits/stdc++.h>
using namespace std;
int main() {
  int gtll;
  int a, b, c;
  cin >> a >> b >> c;
  gtll = a + b + c;
  gtll = max(gtll, a * (b + c));
  gtll = max(gtll, (a + b) * c);
  gtll = max(gtll, a * b * c);
  cout << gtll;
  return 0;
}
