#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  vector<int> vals;
  int val;
  val = a + b + c;
  vals.push_back(val);
  val = a + b * c;
  vals.push_back(val);
  val = a * (b + c);
  vals.push_back(val);
  val = a * b * c;
  vals.push_back(val);
  val = (a + b) * c;
  vals.push_back(val);
  val = a * b + c;
  vals.push_back(val);
  sort(vals.begin(), vals.end());
  cout << vals[vals.size() - 1] << endl;
}
