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