/*#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll n,m,k,cnt;
void ok(ll x)
{
    cnt+=(1ll+x)*x/2ll;
    cnt+=x-1;
}
void anomalous_solve()
{
    cin>>n>>m;
    while(true)
    {
    	//cout<<n<<" "<<m<<"\n";
    	if(n==1 && m==1)
    	{
    		cnt++;break;
		}
		if(n==1)
		{
			ok(m);break;
		}
		if(m==1)
		{
			ok(n);break;
		}
		if(m>n)swap(n,m);
		ok(m);
		cnt+=n*m;
		n--;
		//cout<<cnt<<"\n";
	}
	cout<<cnt;
}
int main()
{
	//	freopen("INPUT.txt","r",stdin);
	//  freopen("OUTPUT.txt","w",stdout);

	ios_base::sync_with_stdio();
    cin.tie(NULL);
    cout.tie(NULL);

    ll test=1;
	//cin>>test;
    for(int pos=1;pos<=test;pos++)
    	anomalous_solve();
}
