#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <cctype>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <iomanip>

using namespace std;

typedef long long LL;

#define REP(i, n) for (int i(0); i < (int) (n); i++)

const int N = 20 + 2;
const int INF = 1000000;

int n, m;
int ret;
int color[N][N];

int ok(int x, int y)
{
	static int c[4];
	c[0] = color[x][y];
	c[1] = color[x + 1][y];
	c[2] = color[x][y + 1];
	c[3] = color[x + 1][y + 1];
	for(int i = 0; i < 4; ++ i)
		for(int j = i + 1; j < 4; ++ j)
			if (c[i] == c[j])
				return true;
	return false;
}

int ok(int xa, int ya, int xb, int yb)
{
	if (color[xb][yb] >= 0) return false;
	if (color[xa][ya] >= 0) return false;
	color[xa][ya] = color[xb][yb] = INF;
	for(int cx = xa - 1; cx <= xb; ++ cx) {
		for(int cy = ya - 1; cy <= yb; ++ cy) {
			if (! ok(cx, cy)) {
				color[xa][ya] = color[xb][yb] = -1;
				return false;
			}
		}
	}
	color[xa][ya] = color[xb][yb] = -1;
	return true;
}

set<vector<vector<int> > > ss;

void dfs(int cur)
{
	if (cur * 2 == n * m) {
		++ ret;
		return;
	}
	int ways = 5, rx, ry;
	for(int i = 1; i <= n; ++ i) {
		for(int j = 1; j <= m; ++ j) {
			if (color[i][j] >= 0) continue;
			int curWays = 0;
			if (i + 1 <= n && ok(i, j, i + 1, j)) {
				++ curWays;
			}
			if (j + 1 <= m && ok(i, j, i, j + 1)) {
				++ curWays;
			}
			if (i - 1 >= 1 && ok(i - 1, j, i, j)) {
				++ curWays;
			}
			if (j - 1 >= 1 && ok(i, j - 1, i, j)) {
				++ curWays;
			}
			if (curWays < ways) {
				ways = curWays;
				rx = i;
				ry = j;
			}
		}
	}
	if (ways == 0 || ways == 5) {
		return;
	}
	int i = rx, j = ry;
	if (i + 1 <= n && ok(i, j, i + 1, j)) {
		color[i][j] = color[i + 1][j] = cur;
		dfs(cur + 1);
		color[i][j] = color[i + 1][j] = -1;
	}
	if (i - 1 >= 1 && ok(i - 1, j, i, j)) {
		color[i - 1][j] = color[i][j] = cur;
		dfs(cur + 1);
		color[i - 1][j] = color[i][j] = -1;
	}
	if (j + 1 <= m && ok(i, j, i, j + 1)) {
		color[i][j] = color[i][j + 1] = cur;
		dfs(cur + 1);
		color[i][j] = color[i][j + 1] = -1;
	}
	if (j - 1 >= 1 && ok(i, j - 1, i, j)) {
		color[i][j - 1] = color[i][j] = cur;
		dfs(cur + 1);
		color[i][j - 1] = color[i][j] = -1;
	}
}

void solve() {
	memset(color, -1, sizeof color);
	if (n * m & 1) {
		cout << 0 << endl;
		return;
	}
	ret = 0;
	ss.clear();
	dfs(0);
	cout << ret << endl;
	/*  for(set<vector<vector<int> > >::iterator it = ss.begin(); it != ss.end(); ++ it) {
		for(int i = 0; i < n; ++ i) {
		for(int j = 0; j < m; ++ j) {
		cout << (*it)[i][j] << ' ';
		}
		cout << endl;
		}
		cout << endl << endl;
		}*/
}

int main() {
	for( ; cin >> n >> m && (n || m); ) {
		solve();
	}
	return 0;
}