#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const double PI = acos(-1.0);
const int MAXN = 25;
const int MOD = 1e9 + 7;
int sgn(double x) {
  if (fabs(x) < eps) return 0;
  if (x < 0)
    return -1;
  else
    return 1;
}
long long pw(long long a, long long n, long long mod) {
  long long ret = 1;
  while (n) {
    if (n & 1) ret = ret * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ret;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int n, t, lim[MAXN];
long long dp[MAXN][5][MAXN];
void gao(int a, int b, int c) {
  if (c & 1) {
    for (int j = 1; j < b; j++) dp[a + 1][j][c] += dp[a][b][c];
    for (int j = b + 1; j <= 4; j++) dp[a + 1][j][c + 1] += dp[a][b][c];
  } else {
    for (int j = 1; j < b; j++) dp[a + 1][j][c + 1] += dp[a][b][c];
    for (int j = b + 1; j <= 4; j++) dp[a + 1][j][c] += dp[a][b][c];
  }
}
int main() {
  scanf("%d%d", &n, &t);
  t = 2 * t - 1;
  lim[1] = lim[2] = 0;
  for (int i = 3; i <= n; i++) lim[i] = lim[i - 1] + 1;
  for (int j = 1; j <= 3; j++) dp[1][j][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= 4; j++)
      for (int k = 0; k <= min(lim[i], t); k++) gao(i, j, k);
  long long ans = 0;
  for (int j = 1; j <= 3; j++) ans += dp[n][j][t];
  printf("%I64d\n", ans);
}
