#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

long line(int a) {
    if (a%2==0) return (2+a)*(a/2-1)+a/2+1+a;
    else return (2+a)*(a/2)+a;
}

int main() {
    int n, m;
    long ans=4;
    cin >> n >> m;
    int i=min(n,m), j=max(n,m);
    if (n*m==1) cout << 1;
    else if (n*m==2) cout << 4;
    else {
        while (i*j!=2){
           if (j < i) swap(i,j);
            ans+=i*j;
            j-=1;
            ans+=line(i);
        }
        cout<< ans;
    }
}
