#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  ;
  int a, b, c;
  cin >> a >> b >> c;
  int ans;
  int e, f, g, h, i, j, k;
  e = a + b + c;
  f = a + (b * c);
  g = a * b * c;
  h = (a + b) * c;
  i = a * (b + c);
  ans = max(e, (max(f, max(g, max(h, i)))));
  cout << ans;
}
