#include<bits/stdc++.h>
using namespace std;
int n,m,ans;
bool vis[20][20];
inline void dfs(int x,int y){
// cout<<x<<" "<<y<<endl;
if(x==n&&y==m){
ans++;
// return;
}
if(x+2<=n&&y+1<=m) dfs(x+2,y+1);
if(x+1<=n&&y+2<=m) dfs(x+1,y+2);
if(x-1>=0&&y+2<=m) dfs(x-1,y+2);
if(x-2>=0&&y+1<=m) dfs(x-2,y+2);
}
int main(){
scanf("%d%d",&n,&m);
vis[0][0]=true;
vis[2][1]=vis[1][2]=1;
dfs(0,0);
cout<<ans<<endl;
return 0;
}