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