#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int e1 = a + b + c;
  int e2 = a + b * c;
  int e3 = (a + b) * c;
  int e4 = a * b + c;
  int e5 = a * (b + c);
  int e6 = a * b * c;
  int m1 = max(max(e1, e2), max(e3, e4));
  int m2 = max(e5, e6);
  cout << max(m1, m2) << endl;
}
