#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int w, x, y, z, l, m;
  w = a + b * c;
  x = a * (b + c);
  y = a * b * c;
  z = (a + b) * c;
  l = a + b + c;
  m = a * b + c;
  cout << max(w, max(x, max(y, max(z, max(l, m)))));
  return 0;
}
