
#include <iostream>
using namespace std;
int main()
{
    int h,w;
    cin>>h>>w;
    long long S;
    if (h%2 == 0)
    {
        S = (h+1) * (h/2) + h-1;
    }
    else
    {
        S = (h+1) * (h/2) + (h/2 + 1) + h-1;
    }
    long long sum=0;
    for(int i=w;i>=2;i--)
    {
        sum+=i;
    }
    cout<<S * w + h*sum;
}
