#include <bits/stdc++.h>
int dp[30][30][30];
int main() {
  int n, t;
  while (scanf("%d%d", &n, &t) == 2) {
    memset(dp, 0, sizeof(dp));
    dp[1][0][1] = dp[1][0][2] = dp[1][0][3] = dp[1][0][4] = 1;
    for (int i = 1; i < n; i++)
      for (int j = 0; j <= 2 * t; j++)
        for (int k = 0; k <= 4; k++) {
          if (dp[i][j][k] == 0) continue;
          int tj;
          for (int tk = 1; tk <= 4; tk++) {
            if (j == 0 && tk < k) continue;
            if (tk == k) continue;
            if (tk > k) {
              if (j % 2 == 1)
                tj = j;
              else if (j != 2 * t)
                tj = j + 1;
              else
                continue;
            } else {
              if (j % 2 == 1)
                tj = j + 1;
              else
                tj = j;
            }
            dp[i + 1][tj][tk] += dp[i][j][k];
          }
        }
    int ans = 0;
    for (int i = 1; i <= 4; i++) ans += dp[n][2 * t][i];
    printf("%d\n", ans);
  }
  return 0;
}
