#include <bits/stdc++.h>
using namespace std;
long long n = 0, k[10000001], a, b, c;
void nhap() { cin >> a >> b >> c; }
void solve() {
  k[n] = a + b + c;
  n++;
  k[n] = a * b * c;
  n++;
  k[n] = (a + b) * c;
  n++;
  k[n] = a * (b + c);
  n++;
  k[n] = a + b * c;
  n++;
  k[n] = a * b + c;
  n++;
  sort(k, k + n);
  cout << k[n - 1];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  nhap();
  solve();
}
