#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d[6];
  cin >> a >> b >> c;
  d[0] = a + b * c;
  d[1] = a * (b + c);
  d[2] = a * b * c;
  d[3] = (a + b) * c;
  d[4] = a + b + c;
  d[5] = (a * b) + c;
  cout << max(max(max(max(max(d[0], d[1]), d[2]), d[3]), d[4]), d[5]);
  return 0;
}
