#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1005;
long long dp[2][22][15][6];
int main() {
  int n, t;
  scanf("%d%d", &n, &t);
  for (int i = 1; i <= 4; i++) dp[0][1][0][i] = 1;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= t; j++) {
      for (int k = 1; k <= 4; k++) {
        for (int h = 1; h < k; h++)
          dp[1][i][j][k] += dp[0][i - 1][j - 1][h] + dp[1][i - 1][j][h];
        for (int h = k + 1; h <= 4; h++)
          dp[0][i][j][k] += dp[0][i - 1][j][h] + dp[1][i - 1][j][h];
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= 4; i++) ans = ans + dp[0][n][t][i];
  printf("%I64d\n", ans);
  return 0;
}
