#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  int res;
  cin >> a;
  cin >> b;
  cin >> c;
  res = a + b * c;
  if (a * (b + c) > res) res = a * (b + c);
  if (a * b * c > res) res = a * b * c;
  if ((a + b) * c > res) res = (a + b) * c;
  if (a + b + c > res) res = a + b + c;
  cout << res;
}
