import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int k = sc.nextInt(); int[] counts = new int[1 << 16]; ArrayList> dp = new ArrayList<>(); for (int i = 0; i < (1 << 16); i++) { for (int j = 0; j < 16; j++) { if (j % 4 == 3) { continue; } if (((i & (1 << j)) == 0) != ((i & (1 << (j + 1))) == 0)) { counts[i]++; } } for (int j = 0; j < 12; j++) { if (((i & (1 << j)) == 0) != ((i & (1 << (j + 4))) == 0)) { counts[i]++; } } dp.add(new HashMap<>()); } dp.get(0).put(0, 1L); for (int i = 1; i < (1 << 16); i++) { for (int j = 0; j < 16; j++) { if ((i & (1 << j)) == 0) { continue; } for (Map.Entry entry : dp.get(i ^ (1 << j)).entrySet()) { int key = entry.getKey(); long value = entry.getValue(); dp.get(i).put(key + counts[i], dp.get(i).getOrDefault(key + counts[i], 0L) + value); } } } System.out.println(dp.get((1 << 16) - 1).getOrDefault(k, 0L)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }