#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, t;
  cin >> n >> t;
  long long f[25][25][6];
  long long i, j, k, p;
  for (i = 1; i <= 4; i++) f[1][0][i] = 1;
  for (i = 2; i <= n; ++i)
    for (j = 1; j <= 2 * t; ++j)
      for (k = 1; k <= 4; ++k) {
        f[i][j][k] == 0;
        if (j % 2 == 0)
          for (p = k + 1; p <= 4; p++)
            f[i][j][k] += f[i - 1][j][p] + f[i - 1][j - 1][p];
        else
          for (p = 1; p < k; p++)
            f[i][j][k] += f[i - 1][j][p] + f[i - 1][j - 1][p];
      }
  long long result = 0;
  for (i = 1; i <= 4; i++) result += f[n][2 * t][i];
  printf("%d", result);
  return 0;
}
