#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int dx[4] = {2, 1, -1, -2};
int dy[4] = {1, 2, 2, 1};
int ans = 0, n, m;
void dfs(int x, int y) {
if (x == n && y == m) ans ++;
if (x < 0 || x > n || y > m) return ;
for (register int i = 0; i < 4; i ++)
dfs(x + dx[i], y + dy[i]);
}
int main() {
freopen("horse.in", "r", stdin);
freopen("horse.out", "w", stdout);
scanf("%d %d", &n, &m);
n --, m --;
dfs(0, 0);
printf("%d\n", ans);
return 0;
}