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