#include <bits/stdc++.h>
int main() {
  int a, b, c;
  int swap, i, j;
  int ara[5];
  scanf("%d %d %d", &a, &b, &c);
  ara[0] = a + b * c;
  ara[1] = a * (b + c);
  ara[2] = a * b * c;
  ara[3] = (a + b) * c;
  ara[4] = a + b + c;
  for (i = 0; i < (5 - 1); i++) {
    for (j = 0; j < 5 - i - 1; j++) {
      if (ara[j] < ara[j + 1]) {
        swap = ara[j];
        ara[j] = ara[j + 1];
        ara[j + 1] = swap;
      }
    }
  }
  printf("%d", ara[0]);
  return 0;
}
