#include <bits/stdc++.h>
using namespace std;
int min(int a, int b) {
  int min = a;
  if (b < a) {
    min = b;
  }
  return min;
}
int main() {
  int a, b, c, ans, min;
  cin >> a;
  cin >> b;
  cin >> c;
  if (a == 1 && b != 1 && c != 1) {
    ans = (a + b) * c;
  } else if (a != 1 && b != 1 && c == 1) {
    ans = a * (b + c);
  } else if (a != 1 && b == 1 && c != 1) {
    if (a < c) {
      ans = (a + b) * c;
    } else {
      ans = a * (b + c);
    }
  } else if (a == 1 && b == 1 && c != 1) {
    ans = (a + b) * c;
  } else if (a != 1 && b == 1 && c == 1) {
    ans = a * (b + c);
  } else if (a == 1 && c == 1) {
    ans = a + b + c;
  } else {
    ans = a * b * c;
  }
  cout << ans;
  return 0;
}
