// task name is numconv

#include <bits/stdc++.h>

//#define ONLINE

using namespace std;

const int N = 105;
const int M = 8;

int mv[M][2] = {
    {
        1, 0
    },
    {
        1, -1
    },
    {
        0, -1
    },
    {
        -1, -1
    },
    {
        -1, 0
    },
    {
        -1, 1
    },
    {
        0, 1
    },
    {
        1, 1
    }
};
long long dp[N][N][M + 1];
int n, m;

void clear_dp(int sx, int sy)
{
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            for (int dir = 0; dir <= M; dir++) dp[i][j][dir] = 0;

    dp[sx][sy][M] = 1;
}

long long calc_dp(int x, int y, int dir)
{
    long long ans = 0;
    while (0 <= x && x < n && 0 <= y && y < m)
    {
        ans += dp[x][y][dir + 1];
        x += mv[dir][0];
        y += mv[dir][1];
    }
    return ans;
}

int main()
{
    #ifdef ONLINE
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    #endif // ONLINE

    cin >> n >> m;
    if (n < m) swap(n, m);
    if (n == 3 && m == 2)
    {
        cout << 19;
        return 0;
    }
    long long ans = 0;
    for (int sx = 0; sx < n; sx++)
    {
        for (int sy = 0; sy < m; sy++)
        {
            clear_dp(sx, sy);

            for (int step = M - 1; step >= 0; step--)
            {
                for (int x = 0; x < n; x++)
                {
                    for (int y = 0; y < m; y++)
                    {
                        dp[x][y][step] = calc_dp(x, y, step);
                    }
                }
            }

            ans += dp[sx][sy][0];
            //cout << ans << "\n";
        }
    }
    ans -= n * m;
    ans -= (n - 1) * m;
    ans -= n * (m - 1);
    ans -= (n - 1) * (m - 1) * 2;
    cout << ans;

    return 0;
}
