#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, z, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;
  cin >> x >> y >> z;
  sum1 = x + y + z;
  sum2 = x * (y + z);
  sum3 = x * y * z;
  sum4 = (x + y) * z;
  cout << max(max(sum1, sum2), max(sum3, sum4));
  return 0;
}
