#include <bits/stdc++.h>
using namespace std;
int main() {
  int s1[3];
  while (cin >> s1[0] >> s1[1] >> s1[2]) {
    if (s1[0] + s1[1] + s1[2] == 3)
      cout << "3" << endl;
    else {
      int s2[4];
      s2[0] = s1[0] * s1[1] * s1[2];
      s2[1] = (s1[0] + s1[1]) * s1[2];
      s2[2] = s1[0] * (s1[1] + s1[2]);
      s2[3] = s1[0] + s1[1] + s1[2];
      sort(s2, s2 + 4);
      cout << s2[3] << endl;
    }
  }
  return 0;
}
