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