#include<bits/stdc++.h>
using namespace	std;
#define ll long long
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	ll h,w,sum,dio,sumary;
	cin>>h>>w;
	sum=h*w;
	sumary=sum+(h*w+h*2)*(w-1)/2+(h*w+w*2)*(h-1)/2;
	cout<<sumary; // original
}