#include <bits/stdc++.h>
int main() {
  int a, b, c, r1, r2, r3, r4, r5, max, i;
  scanf("%d%d%d", &a, &b, &c);
  r1 = a + b * c;
  r2 = a * (b + c);
  r3 = a * b * c;
  r4 = (a + b) * c;
  r5 = a + b + c;
  int s[] = {r1, r2, r3, r4, r5};
  max = s[0];
  for (i = 1; i < 5; i++) {
    if (s[i] > max) {
      max = s[i];
    }
  }
  printf("%d\n", max);
  return 0;
}
