#include <bits/stdc++.h>
using namespace std;
int mod1 = int(1e9) + 7;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int m = -1;
  m = max(m, a + b + c);
  m = max(m, a + b * c);
  m = max(m, a * b + c);
  m = max(m, a * b * c);
  m = max(m, a * (b + c));
  m = max(m, (a + b) * c);
  cout << m << endl;
  return 0;
}
