#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, i, T;
  ;
  int ar[5];
  cin >> a >> b >> c;
  ar[0] = a + b * c;
  ar[1] = a * (b + c);
  ar[2] = a * b * c;
  ar[3] = (a + b) * c;
  ar[4] = a + b + c;
  int maximum = ar[0];
  for (i = 1; i < 5; i++) {
    if (maximum < ar[i]) {
      T = maximum;
      maximum = ar[i];
      ar[i] = T;
    }
  }
  cout << maximum << endl;
  return 0;
}
