#include <bits/stdc++.h>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    ll h,w;
    cin>>h>>w;
    if(h==1 and w==1) {cout<<1;return 0;}
    ll ans=0;
    while((h*w)%2==0){
        ans+=(h*w)*2;
        if(h%2==0) h=h/2;
        else w=w/2;
    }
    ll ans1=min(w,h)*((max(w,h)*(max(w,h)+1)/2-1)*2);
    cout<<ans+ans1;
}
