#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int mod = 104857601;
void reduce(int &a) { a += a >> 31 & mod; }
int Mod(int x) { return x >= mod ? x - mod : x; }
long long read() {
  long long x = 0;
  int f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + (ch ^ 48);
  return x * f;
}
void print(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
int n, t, f[21][5][11][2];
int main() {
  n = read(), t = read();
  for (int i = 2; i < 5; i++) f[2][i][1][1] = i - 1;
  for (int i = 3; i <= n; i++)
    for (int j = 1; j <= 4; j++)
      for (int k = 1; k <= t; k++) {
        for (int r = 4; r > j; r--)
          f[i][j][k][0] += f[i - 1][r][k][0] + f[i - 1][r][k][1];
        for (int r = 1; r < j; r++)
          f[i][j][k][1] += f[i - 1][r][k][1] + f[i - 1][r][k - 1][0];
      }
  int ans = 0;
  for (int i = 1; i <= 4; i++) ans += f[n][i][t][0];
  print(ans), putchar('\n');
  return 0;
}
