import Control.Applicative
import Data.List
import Data.Char

strip :: String -> String
strip = reverse . dropWhile isSpace . reverse . dropWhile isSpace

calc :: Int -> Int
calc n = length [True | a <- [0..9],
                        b <- [0..9],
                        c <- [0..9],
                        d <- [0..9],
                        a + b + c + d == n]

main :: IO ()
main = do
  s <- getContents
  putStrLn $ show $ lines $ strip s
  let xs = map read $ lines $ strip s :: [Int]
  mapM_ putStrLn $ map (show . calc) xs