
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
//#pragma GCC optimization("unroll-loops")


//#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include<stack>
#include<string>
#include<string.h>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>


#define ll long long
#define boost ios_base::sync_with_stdio(NULL);cin.tie(0);cout.tie(0)
using namespace std;


int main()
{
 //freopen("input.txt", "r", stdin);
    ///freopen("output.txt", "w", stdout);
 boost;
  
    ll a,b;
    cin >> a >> b;
    if(a < b) 
        swap(a, b);
    
    ll diameter = 0,ans = a * b;
    for(ll i = b;i >= 2;i--){
        diameter += i;
        diameter++;
    }
    diameter ++;
     ans += diameter * (a - 2 + 2);
 
    for(ll i = a - 1;i >= 2;i --) {
        ans += i * b;
    }
    cout << ans;

}