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