#include <bits/stdc++.h>
using namespace std;
int n, t, ans;
int dp[25][8][15][2];
int main() {
  cin >> n >> t;
  for (int j = 1; j <= 3; j++) dp[0][j][0][0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 1; j <= 4; j++)
      for (int k = 0; k <= t; k++) {
        if (dp[i][j][k][0]) {
          for (int h = j + 1; h <= 4; h++) dp[i + 1][h][k][0] += dp[i][j][k][0];
          for (int h = j - 1; h >= 1 && i != 0; h--)
            dp[i + 1][h][k + 1][1] += dp[i][j][k][0];
        }
        if (dp[i][j][k][1]) {
          for (int h = j - 1; h >= 1; h--) dp[i + 1][h][k][1] += dp[i][j][k][1];
          for (int h = j + 1; h <= 4; h++) dp[i + 1][h][k][0] += dp[i][j][k][1];
        }
      }
  for (int j = 1; j <= 4; j++) ans += dp[n - 1][j][t][1];
  cout << ans << endl;
  return 0;
}
