#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, f[6];
  cin >> a >> b >> c;
  f[0] = a + b + c;
  f[1] = a + b * c;
  f[2] = a * b + c;
  f[3] = a * b * c;
  f[4] = (a + b) * c;
  f[5] = a * (b + c);
  sort(f, f + 6);
  cout << f[5];
  return 0;
}
