#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
int map[100][100];
int temp[100][100];
int x[4]={0,0,1,-1};
int y[4]={-1,1,0,0};
int ans;
int search(int a,int b,int m,int n)
{
for(int i=0;i<=a;i++)
for(int k=0;k<=b;k++)
{
map[i][k]=1;
}
if(m==a&&n==b)
ans++;
if(m<=a&&n<=b)
{
for(int p=0;p<=3;p++)
{
if(temp[m+x[p]][n+y[p]]==0&&map[m+x[p]][n+y[p]]==1)
temp[m][n]=1;
search(a,b,m,n);
temp[m][n]=0;
}
}
}
int main()
{
int o,p;
cin>>o>>p;
//for(int i=1;i<=o;i++)
//for(int k=1;k<=p;k++)
//{
//map[i][k]=1;
//}
search(4,4,o,p);
cout<<ans;
return 0;
}
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
int map[100][100];
int temp[100][100];
int x[4]={0,0,1,-1};
int y[4]={-1,1,0,0};
int ans;
int search(int a,int b,int m,int n)
{
for(int i=0;i<=a;i++)
for(int k=0;k<=b;k++)
{
map[i][k]=1;
}
if(m==a&&n==b)
ans++;
if(m<=a&&n<=b)
{
for(int p=0;p<=3;p++)
{
if(temp[m+x[p]][n+y[p]]==0&&map[m+x[p]][n+y[p]]==1)
temp[m][n]=1;
search(a,b,m,n);
temp[m][n]=0;
}
}
}
int main()
{
int o,p;
cin>>o>>p;
//for(int i=1;i<=o;i++)
//for(int k=1;k<=p;k++)
//{
//map[i][k]=1;
//}
search(4,4,o,p);
cout<<ans;
return 0;
}