let rec range s t = if s > t then [] else s :: range (s + 1) t

let _ =
  let lst = range 0 9999 in
  let rec sum n r x =
    if n = 0 then r
    else sum (n - 1) (r + (x mod 10)) (x / 10) in
  try
    while true do
      let n = Scanf.scanf "%d\n" (fun x -> x) in
      Printf.printf "%d\n" (List.length (List.filter (fun x -> (sum 4 0 x) = n) lst))
    done
  with
    End_of_file -> ()