#include <bits/stdc++.h>
#define ll long long
#define all(a) a.begin(), a.end()
#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define ull unsigned long long
#define ld long double
#define files freopen("HelpMe.in", "r", stdin), freopen("HelpMe.out", "w", stdout)
using namespace std;
const ll mod = 1e9+7;
const ll N = 2e5 + 5;
const ll P = 337ll;
const ld EPS = 1e-9;
const ll block = 400;
ll ans = 0, h,w;
queue <pair<ll,ll>> q;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>h>>w;
ans = h*w;
if(h<w) {
    swap(h,w);
}
q.push({h,w});
ll cnt = 0;
while(!q.empty()) {
    cnt++;
    pair <ll,ll> d = q.front();
    q.pop();
    //cout<<d.F<<" "<<d.S<<"\n";
    if(d.F <= 1 && d.S <= 1) {
        continue;
    }
    ans+=d.F*d.S;
    //cout<<d.F*d.S<<" ";
    if((d.F-1) * d.S + d.S >= d.F * (d.S-1) + d.F) {
        q.push({max(d.F-1, d.S), min(d.F-1, d.S)});
        ans+=(d.S * (d.S+1) / 2ll) - 1;
       // cout<<(d.S * (d.S+1) / 2ll) - 1<<" ";
    }
    else{
        q.push({max(d.F, d.S-1), min(d.F, d.S-1)});
        ans+=(d.F * (d.F+1) / 2ll) - 1;
      //  cout<<(d.S * (d.S+1) / 2ll) - 1<<" ";
    }
}
cout<<ans;
return 0;
}
// equal, min, max, 1, random
/*

*/
