#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int c1 = n * m * k;
  int c2 = (n * m) + k;
  int c3 = n + (m * k);
  int c4 = n + m + k;
  int c5 = n * (m + k);
  int c6 = (n + m) * k;
  cout << max(max(max(c1, c2), max(c5, c6)), max(c3, c4)) << endl;
  return 0;
}
