#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int res1, res2, res3, res4, res5, res6;
  res1 = a * b * c;
  res2 = (a + b) * c;
  res3 = a * (b + c);
  res4 = a * b + c;
  res5 = a + b * c;
  res6 = a + b + c;
  cout << max(max(res1, max(res2, res3)), max(res4, max(res5, res6)));
  return 0;
}
