#include <bits/stdc++.h>
using namespace std;
inline string IS(int a) {
  char x[100];
  sprintf(x, "%d", a);
  string s = x;
  return s;
}
inline int SI(string a) {
  char x[100];
  int res;
  strcpy(x, a.c_str());
  sscanf(x, "%d", &res);
  return res;
}
int a, b, c, d, e, f, g, h, i, maks;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> a >> b >> c;
  d = a + (b * c);
  maks = max(maks, d);
  e = (a + b) * c;
  maks = max(maks, e);
  f = (a * b) + c;
  maks = max(maks, f);
  g = a * (b + c);
  maks = max(maks, g);
  h = a * b * c;
  maks = max(maks, h);
  i = a + b + c;
  maks = max(maks, i);
  cout << maks << endl;
  return 0;
}
