#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define MT(a,b,c) MP(a, MP(b, c))

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int board[44][44];
int h, w;

int DFS(int x, int y, int n){
	int ret = 0;
	while(board[x][y] != 0){
		x++;
		if(x > w){
			y++;
			x = 1;
			if(y > h)return 1;
		}
	}
	//たて向き
	if(board[x][y+1]==0){
		int check = 0;
		if(board[x][y-1] != board[x+1][y-1])check++;
		if(board[x+1][y-1] != board[x+1][y])check++;
		if(check != 2){
			board[x][y] = n;
			board[x][y+1] = n;
			ret += DFS(x,y,n+1);
			board[x][y] = 0;
			board[x][y+1] = 0;
		}
	}
	//よこ向き
	if(board[x+1][y]==0){
		int check = 0;
		if(board[x+1][y-1] != board[x+2][y-1])check++;
		if(board[x+2][y] != board[x+2][y-1])check++;
		if(check != 2){
			board[x][y] = n;
			board[x+1][y] = n;
			ret += DFS(x,y,n+1);
			board[x][y] = 0;
			board[x+1][y] = 0;
		}
	}
	return ret;
}

int main(){
	while(1){
		memset(board, 0, sizeof(board));
		cin >> h>> w;
		if(h==0)break;
		REP(i,w+2){
			board[i][0] = 1000;
			board[i][h+1] = 1000;
		}
		REP(i,h+2){
			board[0][i] = 1000;
			board[w+1][i] = 1000;
		}
		if(h==0)return 0;
		cout << DFS(1, 1, 1) << endl;
	}
}