#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int max = 0;
  int d = a * b * c;
  if (max < d) max = d;
  d = a + b + c;
  if (max < d) max = d;
  d = (a * b) + c;
  if (max < d) max = d;
  d = a * (b + c);
  if (max < d) max = d;
  d = (a + b) * c;
  if (max < d) max = d;
  d = a + (b * c);
  if (max < d) max = d;
  cout << max;
}
