# まず実験するか from itertools import permutations count = [[0]*(21) for i in range(21)] for N in range(2, 5): for combo in permutations(range(1, N+1), N): #print(combo) temp = 0 for j in range(1, N): if combo[j]-combo[j-1] < 0: temp += 1 if temp == 1: count[N][20-N+combo[0]] += 1 for N in range(5, 21): temp = 0 for j in range(20, -1, -1): count[N][j] = 2**temp temp += 1 if temp == N: count[N][j] = sum(count[N-1]) break n, k = map(int, input().split()) ans = count[n][20-n+k] print(ans)