#include <bits/stdc++.h>
int larger(int m, int n) {
  if (m > n)
    return m;
  else
    return n;
}
int main() {
  int a, b, c, c1, c2, c3, c4, c5, s1, s2, s3, s4;
  scanf("%d%d%d", &a, &b, &c);
  c1 = a + (b * c);
  c2 = a * (b + c);
  c3 = a * b * c;
  c4 = (a + b) * c;
  c5 = a + b + c;
  s1 = larger(c1, c2);
  s2 = larger(s1, c3);
  s3 = larger(s2, c4);
  s4 = larger(s3, c5);
  printf("%d", s4);
  return 0;
}
