#include <bits/stdc++.h>
using namespace std;
void fre() {
  ofstream fre("42.inp");
  {
    fre << R"(
)";
  }
  fre.close();
  freopen(
      "42"
      ".inp",
      "r", stdin);
}
inline long long in() {
  long long x = 0;
  int n = 1;
  char c = getchar();
  while (!isdigit(c)) {
    n = (c == '-') ? -1 : 1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * n;
}
inline char inchar() {
  char c = getchar();
  while (c == ' ' && c == '\n') c = getchar();
  return c;
}
int a, b, c, res;
int main() {
  cin >> a >> b >> c;
  res = max(res, a * b * c);
  res = max(res, a * b + c);
  res = max(res, a + b * c);
  res = max(res, (a + b) * c);
  res = max(res, a * (b + c));
  res = max(res, a + b + c);
  cout << res;
}
