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