#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > q;
bool cmp(pair<int, int> a, pair<int, int> b) {
  if (a.first < b.first) {
    return true;
  }
  if (a.first == b.first) {
    if (a.second < b.second)
      return true;
    else
      return false;
  } else {
    return false;
  }
}
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int ans = a + b * c;
  ans = max(ans, a + b + c);
  ans = max(ans, a * (b + c));
  ans = max(ans, a * b * c);
  ans = max(ans, (a + b) * c);
  ans = max(ans, a * b + c);
  cout << ans;
  return 0;
}
