#include <bits/stdc++.h>
using namespace std;
int main() {
  int num[3];
  cin >> num[0] >> num[1] >> num[2];
  char c1 = '*', c2 = '*';
  if (num[0] == 1) c1 = '+';
  if (num[2] == 1) c2 = '+';
  if (num[1] == 1 && num[0] != 1 && num[2] != 1) {
    cout << max(num[0] * (num[1] + num[2]), (num[0] + num[1]) * num[2]);
    return 0;
  }
  if (c1 == '+' && c2 == '*') {
    cout << ((num[0] + num[1]) * num[2]);
    return 0;
  }
  if (c2 == '+' && c1 == '*') {
    cout << (num[0] * (num[1] + num[2]));
    return 0;
  }
  if (c1 == '+' && c2 == '+') {
    cout << (num[0] + num[1] + num[2]);
    return 0;
  }
  cout << (num[0] * num[1] * num[2]);
  return 0;
}
