#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, mx = 0;
  scanf("%d %d %d", &a, &b, &c);
  mx = max(a + b + c, mx);
  mx = max((a + b) * c, mx);
  mx = max((a * b) + c, mx);
  mx = max(a * (b + c), mx);
  mx = max(a + (b * c), mx);
  mx = max(a * b * c, mx);
  cout << mx;
  return 0;
}
