#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)

using namespace std;
typedef long long ll;

const int    INF = 1000000000;
const int    MOD = 1000000007;
const double EPS = 1e-8;
bool used[30][30];
bool forbid[30][30];
int H, W;
int dfs(int x, int y){
    if(x == W) return dfs(0, y + 1);
    if(y == H) return 1;
    if(used[y][x]) return dfs(x + 1, y);
    if(forbid[y][x]) return 0;
    int res = 0;
    if(y + 1 < H && !used[y][x] && !used[y + 1][x]){
        bool tmp = forbid[y + 2][x + 1];
        used[y][x] = true;
        used[y + 1][x] = true;
        forbid[y + 2][x + 1] = true;
        res += dfs(x + 1, y);
        used[y][x] = false;
        used[y + 1][x] = false;
        forbid[y + 2][x + 1] = tmp;
    }
    if(x + 1 < W && !used[y][x] && !used[y][x + 1]){
        bool tmp = forbid[y + 1][x + 2];
        used[y][x] = true;
        used[y][x + 1] = true;
        forbid[y + 1][x + 2] = true;
        res += dfs(x + 2, y);
        used[y][x] = false;
        used[y][x + 1] = false;
        forbid[y + 1][x + 2] = tmp;
    }
    return res;
}
int main(){
    while(cin >> H >> W && (H > 0 && W > 0)){
        memset(used, 0, sizeof used);
        memset(forbid, 0, sizeof forbid);
        REP(y, 30) REP(x, 30) assert(!used[y][x]);
        REP(y, 30) REP(x, 30) assert(!forbid[y][x]);
        cout << dfs(0, 0) << endl;
    }
    return 0;
}