#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main (){
       ios_base::sync_with_stdio(0);
       ll t , q , f , l , r , x , y , i , n , m , j , k , mn = 2e9, mx = -2e9;
       cin>>n>>m;
       if(m>n) swap(n,m);
 ll sum=n*m;
 ll cum=0;
  for(i=m;i>=2;i--){
      cum+=i;
  }
 for(i=n;i>=1;i--){
     sum+=i*m;
     sum+=cum;
 }
 cout<<sum-m;
 }