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