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