#include<bits/stdc++.h>usingnamespace std;typedeflonglong ll;#definerep(i, a, n)for(int i = a; i <= n; i++)#defineper(i, a, n)for(int i = n; i >= a; i--)#definelowbit(x)((x)&-(x))#definelsonp <<1, l, mid#definersonp <<1|1, mid +1, r#definemem(a, b)memset(a, b,sizeof(a))#defineIOS\ios::sync_with_stdio(false);\cin.tie(0);\cout.tie(0)constdouble PI =acos(-1.0);const ll mod =1e9+7;
ll powmod(ll a, ll b){
ll res =1;
a %= mod;assert(b >=0);for(; b; b >>=1){if(b &1)
res = res * a % mod;
a = a * a % mod;}return res;}
ll gcd(ll a, ll b){return b ?gcd(b, a % b): a;}template<classT>inlinevoidread(T &res){char c;
T flag =1;while((c =getchar())<'0'|| c >'9')if(c =='-')
flag =-1;
res = c -'0';while((c =getchar())>='0'&& c <='9')
res = res *10+ c -'0';
res *= flag;}constint N =(1<<10)+5;
ll dp[13][N][102];//第i行,j状态,已经放置了k个国王的方案数量int n, k;boolcheck(int x){for(int i =0; i < n -1; i++){int l =(x >> i)&1;int r =(x >>(i +1))&1;if(l == r && l ==1)return1;}return0;}intget_cnt(int x){int res =0;while(x){if(x &1)
res++;
x >>=1;}return res;}intmain(){
IOS;
cin >> n >> k;
dp[0][0][0]=1;for(int i =1; i <= n; i++)//行数{for(int j =0; j <(1<< n); j++)//i层的状态{if(check(j))//保证无相邻1continue;for(int jj =0; jj <(1<< n); jj++)//i-1层状态{if(check(jj))//保证无相邻1continue;int x = j <<1;int xx = j;int xxx = j >>1;if((x & jj)||(xx & jj)||(xxx & jj))continue;//不合法int cnt_jj =get_cnt(jj);//当前层放置了jj个int cnt_j =get_cnt(j);for(int z =0; z <= k; z++)//枚举已经放置了多少个国王{if(z < cnt_jj || z + cnt_j > k)continue;
dp[i][j][z + cnt_j]+= dp[i -1][jj][z];}}}}
ll res =0;for(int j =0; j <(1<< n); j++)
res += dp[n][j][k];
cout << res;return0;}