#include <bits/stdc++.h>
const double E = exp(1);
const int maxn = 1e6 + 10;
using namespace std;
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  int a, b, c;
  cin >> a >> b >> c;
  int x = a + b + c;
  x = max(x, a * b * c);
  x = max(x, (a + b) * c);
  x = max(x, a + b * c);
  x = max(x, a * (b + c));
  cout << x << endl;
  return 0;
}
