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.Scanner;

public class Main {
	public static void main(String[] a) {
		final int max = 10;
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		long ans = 0;
		for (int w = 0; w < max; w++) {
			if(n - w > (max - 1) * 3)continue;
			for (int x = w; x < max; x++) {
				if(n - w - x > (max - 1) * 2)continue;
				for (int y = x; y < max; y++) {
					if(n - w - x - y > (max - 1))continue;
					int z = n - w - x - y;
					if(w == x && x == y && y == z){
						ans +=1;
					}else{
						if((w == x && x == y)||(w == x && x == z)||(w == y && y == z)||(x == y && y == z)){
							ans += 4;
						}else{
							if((w == x && y == z)||(w == y && x == z)||(w == z && y == x)){
								ans += 6;
							}else{
								if((w == x)||(w == y)||(w == z)||(x == y)||(x == z)||(y == z)){
									ans += 12;
								}else{
									ans += 24;
								}
							}
						}
					}
				}
			}
		}
		System.out.println(ans);
	}
}