#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, mx = 0;
  cin >> a >> b >> c;
  int ans1a = a + b + c;
  int ans2a = a + b * c;
  int ans3a = a * b + c;
  int ans4a = a * b * c;
  if (ans1a > mx) mx = ans1a;
  if (ans2a > mx) mx = ans2a;
  if (ans3a > mx) mx = ans3a;
  if (ans4a > mx) mx = ans4a;
  int ans1b = (a + b) + c;
  int ans2b = (a + b) * c;
  int ans3b = (a * b) + c;
  int ans4b = (a * b) * c;
  if (ans1b > mx) mx = ans1b;
  if (ans2b > mx) mx = ans2b;
  if (ans3b > mx) mx = ans3b;
  if (ans4b > mx) mx = ans4b;
  int ans1c = a + (b + c);
  int ans2c = a + (b * c);
  int ans3c = a * (b + c);
  int ans4c = a * (b * c);
  if (ans1c > mx) mx = ans1c;
  if (ans2c > mx) mx = ans2c;
  if (ans3c > mx) mx = ans3c;
  if (ans4c > mx) mx = ans4c;
  cout << mx << endl;
  return 0;
}
