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

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int[] list = new int[4];
            for (int i = n < 28 ? 0 : n - 27; i <= Math.min(n, 9); i++) {
                if (n - i > 27) {
                    continue;
                }
                for (int j = n < 28 ? 0 : n - 27; j <= Math.min(n - i, 9); j++) {
                    if (n - i - j > 18) {
                        continue;
                    }
                    for (int k = n < 28 ? 0 : n - 27; k <= Math.min(n - i - j, 9); k++) {
                        if (n - i - j - k > 9) {
                            continue;
                        }
                        list[0] = i;
                        list[1] = j;
                        list[2] = k;
                        list[3] = n - i - j - k;
                        if (list[3] < 10 && sum(list) == n) {
                            count++;
                        }
                    }
                }
            }
            System.out.println(count);
        }

        sc.close();
    }

    static int sum(int[] list) {
        return Arrays.stream(list).sum();
    }
}