#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, s = 0, l = 0;
  cin >> a >> b >> c;
  int ans;
  ans = a + b + c;
  ans = max(ans, (a + b) * c);
  ans = max(ans, a * (b + c));
  ans = max(ans, a * b * c);
  cout << ans << endl;
}
