#include <iostream>

using namespace std;
int func(int a, int b){
    if(a == 1 && b == 1){
        return 1;
    }
    else if(a + b == 3){
        return 4;
    }
    else{
        return func(max(a,b)-1,min(a,b))+a*b+func(1,min(a,b));
    }
}
int main()
{
    int n, m;
    cin >> n >> m;
    cout<<func(n,m);
}