import Text.Printf (printf) binom :: Integral a => a -> a -> a binom n k = product [k + 1 .. n] `div` product [1 .. n - k] computeNum :: Integral a => a -> a computeNum x = if x < 0 || x > 31 then 0 else binom 31 x computeSum :: Integral a => a -> a computeSum x | x <= 0 || x > 31 = 0 | otherwise = (2 ^ 31 - 1) * binom 30 (x - 1) main :: IO () main = do x <- readLn :: IO Integer printf "%Ld %Ld\n" (computeNum x) (computeSum x)