#include <bits/stdc++.h>
using namespace std;
void Expression();
int main() {
  Expression();
  return 0;
}
void Expression() {
  int *ptr, *ptr2;
  ptr = new int[3];
  ptr2 = new int[6];
  for (int i = 0; i < 3; i++) cin >> *(ptr + i);
  *(ptr2) = (*(ptr)) + (*(ptr + 1)) + (*(ptr + 2));
  *(ptr2 + 1) = (*(ptr)) * (*(ptr + 1)) * (*(ptr + 2));
  *(ptr2 + 2) = ((*(ptr)) + (*(ptr + 1))) * (*(ptr + 2));
  *(ptr2 + 3) = ((*(ptr)) * (*(ptr + 1))) + (*(ptr + 2));
  *(ptr2 + 4) = (*(ptr)) + ((*(ptr + 1)) * (*(ptr + 2)));
  *(ptr2 + 5) = (*(ptr)) * ((*(ptr + 1)) + (*(ptr + 2)));
  sort(ptr2, ptr2 + 6);
  cout << *(ptr2 + 5) << endl;
  delete[] ptr;
  delete[] ptr2;
}
