#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, s, d;
  cin >> a >> s >> d;
  int maxxx = a + s + d;
  if (maxxx < a * (s + d)) maxxx = a * (s + d);
  if (maxxx < (a + s) * d) maxxx = (a + s) * d;
  if (maxxx < (a * s) * d) maxxx = a * s * d;
  cout << maxxx << endl;
  return 0;
}
