Problem:
Sum of 4 Integers

Write a program which reads an integer n and identifies the number of combinations of a, b, c and d (0 ≤ a, b, c, d ≤ 9) which meet the following equality:

a + b + c + d = n

For example, for n = 35, we have 4 different combinations of (a, b, c, d): (8, 9, 9, 9), (9, 8, 9, 9), (9, 9, 8, 9), and (9, 9, 9, 8).

Input

The input consists of several datasets. Each dataset consists of n (1 ≤ n ≤ 50) in a line. The number of datasets is less than or equal to 50.

Output

Print the number of combination in a line.

Sample Input

35
1

Output for the Sample Input

4
4

Solution in Ruby (judge verdict: Accepted)

def f(n)
  return 0 if n <= 0 or 36 < n
  f1([], 4, n, 9).reduce(:+)
end

def f1(acc, cnt, n, limit)
  return [ncombination(acc + [0] * cnt)] if n == 0
  lbound = [1, (n / cnt).to_i].max
  ubound = [n, limit].min
  ubound.downto(lbound).flat_map {|x| f1(acc + [x], cnt - 1, n - x, x) }
end

def ncombination(xs)
  @table = {
    [4] => 1,
    [3,1] => 4,
    [2,1,1] => 24 / 2,
    [2,2] => 24 / 2 / 2,
    [1,1,1,1] => 24
  }
  h = {}
  xs.each do |x|
    h[x] ||= 0
    h[x] += 1
  end
  @table[h.values.sort_by{|x| -x }]
end


while line = gets
  puts f(line.to_i)
end