#include <bits/stdc++.h>
using namespace std;
long long int a, b, c, arr[6];
int build() {
  arr[0] = a + b + c;
  arr[1] = (b + c) * a;
  arr[2] = (a + b) * c;
  arr[3] = a + b * c;
  arr[4] = a * b * c;
  return *max_element(arr, arr + 5);
}
int main() {
  cin >> a >> b >> c;
  cout << build() << endl;
  return 0;
}
