/*#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 iste(ll a,ll b)
{
	cnt+=a*b;
	if(a==1 && b==1)return;
	if(a>=b)
	{
		iste(a-1,b);
		iste(1,b);
	}
	else
	{
		iste(a,b-1);
		iste(a,1);
	}
	return;
}
void anomalous_solve()
{
	cin>>n>>m;
	iste(n,m);
	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();
}
