#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y, z, e, s, max1, max2, max3, max4;
  cin >> a >> b >> c;
  x = a + b * c;
  y = a * (b + c);
  z = a * b * c;
  e = (a + b) * c;
  s = a + b + c;
  max1 = (x + y + abs(x - y)) / 2;
  max2 = (max1 + z + abs(max1 - z)) / 2;
  max3 = (max2 + e + abs(max2 - e)) / 2;
  max4 = (max3 + s + abs(max3 - s)) / 2;
  cout << max4 << endl;
  return 0;
}
