#include <bits/stdc++.h>
using namespace std;
long long a, b, c;
int main() {
  while (cin >> a >> b >> c) {
    long long re = 0;
    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;
  }
}
