#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, mx = 0, z[10];
  cin >> a >> b >> c;
  z[0] = a + (b * c);
  z[1] = a * (b + c);
  z[2] = a * b * c;
  z[3] = (a + b) * c;
  z[4] = a + b + c;
  for (int i = 0; i < 5; i++) {
    if (z[i] > mx) {
      mx = z[i];
    }
  }
  cout << mx << endl;
  return 0;
}
