#include <bits/stdc++.h>

using namespace std;

int main() {
    long long h, w, sum = 0;
    cin >> h >> w;
    if (h == 1 || w == 1) {
        for (int i = 0; i <= w; i++) {
            if (h == i) {
                continue;
            }
            sum += i*h;
        }
        for (int i = 0; i <= h; i++) {
            if (w == i) {
                continue;
            }
            sum += i*w;
        }
        cout << sum;
        return 0;
    }
    for (int i = 0; i <= w; i++) {
        sum += i*h;
    }
    for (int i = 0; i <= h; i++) {
        sum += i*w;
    }
    cout << sum + (h+w)%2<< endl;
    return 0;
}
