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