#include <iostream>
#include <fstream>
#include <cstdlib>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
ifstream fin("horse.in");
ofstream fout("horse.out");
int he=0,zo=0;
int heng[4]={-2,-1,1,2};
int zong[4]={1,2,2,1};
int jiyi[25][25]={0};
int dp(int hen,int zon){
if(hen>he||zon>zo)return 0;
if(hen<1)return 0;
if(jiyi[hen][zon]!=0)return jiyi[hen][zon];
if(hen==he&&zon==zo)return 1;
int tem=0;
for(int x=0;x<4;x++){
tem+=dp(hen+heng[x],zon+zong[x]);
}
jiyi[hen][zon]=tem;
return tem;
}
int main(int argc, char *argv[]) {
fin>>he>>zo;
int ans=dp(1,1);
fout<<ans;
return 0;
}