#include <iostream>
#include <algorithm>
#define ll long long
using namespace std;

int main() {
    ll n, m, p, i, j;
    ll ans = 4;
    cin >> n >> m;
    i = min(n, m);
    j = max(n, m);
    if (n == 1 && m == 1) {
        cout << 1;
    } else {
        for (; i * j != 2; j--) {
        	p = max(i,j);
        	i = min(i,j);
        	j = p;
            ans += i * j;
            if (i % 2 == 0) {
                ans +=i+ 1 + (2 + i) * (i / 2 - 1) + i / 2;
            } else {
                ans += i + (2 + i) * (i / 2);
            }
        }
        cout << ans;
    }
}
