#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, t;
  int a, b, c;
  cin >> a >> b >> c;
  vector<int> v;
  int d, e, f, g;
  d = a + b + c;
  e = a + b * c;
  f = (a + b) * c;
  g = (a * b) + c;
  int h = a * (b + c);
  int j = a * b * c;
  v.push_back(d);
  v.push_back(e);
  v.push_back(f);
  v.push_back(g);
  v.push_back(h);
  v.push_back(j);
  sort(v.begin(), v.end());
  cout << v[5];
}
