#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int x1, x2, x3, x4, x5;
  x1 = a + b * c;
  x2 = a * (b + c);
  x3 = a * b * c;
  x4 = (a + b) * c;
  x5 = a + b + c;
  if (x1 >= x2 && x1 >= x3 && x1 >= x4 && x1 >= x5) {
    cout << x1;
  } else if (x2 >= x1 && x2 >= x3 && x2 >= x4 && x2 >= x5) {
    cout << x2;
  } else if (x3 >= x1 && x3 >= x2 && x3 >= x4 && x3 >= x5) {
    cout << x3;
  } else if (x4 >= x1 && x4 >= x2 && x4 >= x3 && x4 >= x5) {
    cout << x4;
  } else if (x5 >= x1 && x5 >= x2 && x5 >= x3 && x5 >= x4) {
    cout << x5;
  }
  return false;
}
