#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  int answer;
  cin >> a >> b >> c;
  answer = a + b + c;
  answer = max(answer, (a + b) * c);
  answer = max(answer, a * (b + c));
  answer = max(answer, a * b * c);
  cout << answer;
  return 0;
}
