#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, ar[4], max = 0;
  cin >> a >> b >> c;
  ar[0] = a + b + c;
  ar[1] = a * (b + c);
  ar[2] = (a + b) * c;
  ar[3] = a * b * c;
  for (int i = 0; i < 4; i++) {
    if (ar[i] > max) max = ar[i];
  }
  cout << max;
}
