#include <bits/stdc++.h>
int main() {
  int a, b, c, e, f, g, h, i, j;
  scanf("%d %d %d", &a, &b, &c);
  e = a + b + c;
  f = (a * b) + c;
  g = a * (b + c);
  h = a * b * c;
  i = a + (b * c);
  j = (a + b) * c;
  int max = e;
  if (f > max) {
    max = f;
  }
  if (g > max) {
    max = g;
  }
  if (h > max) {
    max = h;
  }
  if (i > max) {
    max = i;
  }
  if (j > max) {
    max = j;
  }
  printf("%d", max);
}
