#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define F first
#define S second
#define alla(x, n, c) sort( x + c, x + n + c )
#define allv(x) sort( x.begin(), x.end() )
#define reva(x, n, c) reverse( x + c, x + n + c )
#define revv(x) reverse( x.begin(), x.end() )
#define sz(x) (x).size()
#define nl "\n"
#define IAmTheOneWhoKnocks ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);


void solve()
{
    int h,w;
    cin>>h>>w;
    if(h==1&&w==1){
        cout<<1;
        exit(0);
    }
    long long cnt=(h*w)*2;
    for(int i=1;i<h;i++){
        cnt+=w;
        cnt+=(h-i)*w;
    }
    if(w!=2){
        long long cnt1=((w-1)*w)/2;
        cnt1*=h;
        cnt+=cnt1;
    }
    cout<<cnt;

}

signed main()
{
    IAmTheOneWhoKnocks
    int T = 1;
    //cin >>T;
    while( T-- )
    { solve(); }
    return 0;
}
