#include <bits/stdc++.h>
#define ll long long
#define speed ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define pb push_back


using namespace std;


int main()
{
    speed;
    ll h,w,ans=0,anss;
    cin>>h>>w;
    if(h==1)
    {
        ans+=w;
        while(w>=2)
        {
            ans+=w;
            w--;
        }
        cout<<ans;
    }
    else if(w==1)
    {
        ans+=h;
        while(h>=2)
        {
            ans+=h;
            h--;
        }
        cout<<ans;
    }
    else
    {
    anss+=h*w;
    if(h>w)
    {
        ans+=h;
        while(h>=2)
        {
            ans+=h;
            h--;
        }
        ans*=w;
    }
    else
    {
        ans+=w;
        while(w>=2)
        {
            ans+=w;
            w--;
        }
        ans*=h;
    }
    cout<<ans+anss;
    }
    return 0;
}