#include <bits/stdc++.h>
using namespace std;
void dofast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  dofast();
  int T;
  long long int i, j, n, m, o, k, x, ctr = 0, total = 0, t = 1, flag = 0;
  cin >> m;
  cin >> n;
  cin >> o;
  total = max(m + n + o, o * (m + n));
  total = max(total, m * (o + n));
  total = max(total, m * n * o);
  cout << total << '\n';
  return 0;
}
