#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int a,b,c[21][21]={0};
int find(int q,int w)
{
if (c[q][w]>=0) return c[q][w];
if (q+2==a&&w+1==b) return 1;
if (q+1==a&&w+2==b) return 1;
int p=0;
if (q-2>=1&&w+1<=b) p+=find(q-2,w+1);
if (q-1>=1&&w+2<=b) p+=find(q-1,w+2);
if (q+2<=a&&w+1<=b) p+=find(q+2,w+1);
if (q+1<=a&&w+2<=b) p+=find(q+1,w+2);
c[q][w]=p;
return p;
}
int main()
{
freopen("horse.in","r",stdin);
freopen("horse.out","w",stdout);
memset(c,-1,sizeof(c));
cin>>a>>b;
cout<<find(1,1);
}