public class Main { public static void main(String[] args) { int result = 0; for (int i = 1; i <= 12; i++) { for (int j = 0; j <= 3; j++) { for (int k = 0; k <= 9; k++) { if(j + k == i) { result += 1; } else if(j >= 3 && k >= 2) { break; } } } } System.out.println(result); } }