import Control.Applicative main :: IO () main = solve <$> getLine >>= print solve :: String -> Int solve s | head s == 'x' = 2 ^ 32 - ((read . tail) s) | otherwise = read s