//#pragma GCC optimaze("O3")
//#pragma GCC optimaze("Ofast")
//#pragma GCC optimaze("unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")
#pragma comment(linker, "/STACK:66777216")

#include <bits/stdc++.h>

#define int int64_t
#define ll long long

const int MOD = 1e9 + 7;

using namespace std;
void solve(){
    int h,w;
    cin>>h>>w;
    int ans=0;
    while(h+w>2){
        if(h<w){
            swap(h,w);
        }
        ans+=h*w;
        if(h>1){
            h--;
            ans+=(w*(w+1))/2;
        }else{
            break;
        }
    }
    cout<<ans;
}

signed main() {
    int t=1;
    //cin >> t;
    for(int i = 0; i < t; ++i){
        solve();
    }
    return 0;
}