#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int a, b, c;
  cin >> a >> b >> c;
  int ma = -1;
  ma = max(ma, a + b + c);
  ma = max(ma, a + b * c);
  ma = max(ma, a * b + c);
  ma = max(ma, a * b * c);
  ma = max(ma, (a + b) * c);
  ma = max(ma, a * (b + c));
  cout << ma;
  return 0;
}
