import Data.List
import Data.Char

main = do
    l <- getLine
    let a = sort $ map (digitToInt . (\(c:[]) -> c)) $ words l
    if all even a
        then print 0
        else print $ (a !! 0) * (a !! 1)