#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  long long a, b, c;
  cin >> a >> b >> c;
  cout << max(a * b * c, max((a + b) * c, max(a + b + c, a * (b + c))));
  return 0;
}
