#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;
  if (b == 1) {
    if (a < c) {
      a++;
    } else {
      c++;
      if (a == 1) {
        c++;
      }
    }
    cout << a * b * c;
  } else {
    b += a == 1;
    b += c == 1;
    cout << a * b * c;
  }
  return 0;
}
