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