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 JavaScript (judge verdict: Wrong Answer)

// 標準入力
var fs = require('fs'),
length = fs.fstatSync(process.stdin.fd).size,
buffer = new Buffer(length),
bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),
input = buffer.toString('utf8', 0, bytesRead).split('\n');
main();
 
// ここから
function main(){
  for(var i = 0, len = input.length - 1; i < len; i++){
    var target = input[i] - 0;
    var pattern = 0;
    for(var a = 0; a <= 9; a++){
      if(a >= i)
        continue;

      for(var b = 0; b <= 9; b++){
        if(a + b >= i)
          continue;

        for(var c = 0; c <= 9; c++){
          if(a + b + c >= i)
            continue;

          for(var d = 0; d <= 9; d++){
            if(a + b + c + d == i)
              pattern++;
          }
        }
      }
    }
    console.log(pattern);
  }
}