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