#include <iostream>
using namespace std;
int digitsNo(int a) {
const int TEN = 10;
int no = 1;
a = abs(a);
while (a > 0) {
no *= a % TEN;
a /= TEN;
}
return no;
}
int prodNo(int a, int b) {
return digitsNo(a) * digitsNo(b);
}
int ProdMaxDigits(int a, int b, int c) {
int prod1 = prodNo(a, b);
int prod2 = prodNo(a, c);
int prod3 = prodNo(b, c);
int maxProd = prod1;
if (prod2 > maxProd) {
maxProd = prod2;
}
if (prod3 > maxProd) {
maxProd = prod3;
}
return maxProd;
}
int main() {
int a, b, c;
cin >> a >> b >> c;
int prodMax = ProdMaxDigits(a, b, c);
cout << prodMax;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IGRpZ2l0c05vKGludCBhKSB7CiAgICBjb25zdCBpbnQgVEVOID0gMTA7CiAgICBpbnQgbm8gPSAxOwogICAgYSA9IGFicyhhKTsKICAgIHdoaWxlIChhID4gMCkgewogICAgICAgIG5vICo9IGEgJSBURU47CiAgICAgICAgYSAvPSBURU47CiAgICB9CiAgICByZXR1cm4gbm87Cn0KCmludCBwcm9kTm8oaW50IGEsIGludCBiKSB7CiAgICByZXR1cm4gZGlnaXRzTm8oYSkgKiBkaWdpdHNObyhiKTsKfQoKaW50IFByb2RNYXhEaWdpdHMoaW50IGEsIGludCBiLCBpbnQgYykgewogICAgaW50IHByb2QxID0gcHJvZE5vKGEsIGIpOwogICAgaW50IHByb2QyID0gcHJvZE5vKGEsIGMpOwogICAgaW50IHByb2QzID0gcHJvZE5vKGIsIGMpOwogICAgaW50IG1heFByb2QgPSBwcm9kMTsKICAgIGlmIChwcm9kMiA+IG1heFByb2QpIHsKICAgICAgICBtYXhQcm9kID0gcHJvZDI7CiAgICB9CiAgICBpZiAocHJvZDMgPiBtYXhQcm9kKSB7CiAgICAgICAgbWF4UHJvZCA9IHByb2QzOwogICAgfQoKICAgIHJldHVybiBtYXhQcm9kOwp9CgppbnQgbWFpbigpIHsKICAgIGludCBhLCBiLCBjOwogICAgY2luID4+IGEgPj4gYiA+PiBjOwogICAgaW50IHByb2RNYXggPSBQcm9kTWF4RGlnaXRzKGEsIGIsIGMpOwogICAgY291dCA8PCBwcm9kTWF4OwogICAgcmV0dXJuIDA7Cn0=