#include <bits/stdc++.h>
#define ent '\n'
#define f first
#define s second

using namespace std;
typedef long long ll;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;

const int N = 3e5 + 100;
const int mod = 1e9 + 7;

ll n , m , a[N] , cnt[N] , used[N];

void solve(){
	cin >> n >> m ;
	if(n == 1 && m == 1){
		cout << 1 ;
		return ;
	}
	ll mx = max(n , m);
	ll mn = min(n,  m);
	ll ans = 0 ;
	while(mx > 1){
		ans += mx * mn ;
		mx--;
	}
	while(mn > 1){
		ans += mn * max(n , m);
		mn--;
	}
	cout << ans + n * m;
}

int main(){ 
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int T = 1;
    // cin >> T;
    for(int i = 1;i <= T;i++){
        solve();
    }
}
