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