简单题
#include<cstdio>
#include<algorithm>
using namespace std;typedef unsigned long long ll;int main(){
ll n,m;while(scanf("%llu%llu",&n,&m)==2&&n&&m){
if(n<m) swap(n,m);ll num=0;num+=n*m*(n+m-2);num+=(m*(m-1)*(2*m-4))/3*2;num+=2*(n-m+1)*m*(m-1);printf("%llu\n",num);}
}