/**
* @author: Binoy Barman
* @created: 2024-11-05 19:23:56
**/
#include<bits/stdc++.h>
using namespace std;
#define nl '\n'
#define all(v) v.begin(), v.end()
#define Too_Many_Jobs int tts, tc = 1; cin >> tts; hell: while(tts--)
#define Dark_Lord_Binoy ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifdef LOCAL
#include "debug/whereisit.hpp"
#else
#define dbg(...) 42
#endif
#define int long long
int32_t main() {
Dark_Lord_Binoy
#ifdef LOCAL
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int n, m;
cin >> n >> m;
int ans = n * m;
for (int i = 2; i <= min(n, m); i++) {
int r = n - i + 1, c = m - i + 1;
ans += max(0LL, r * c);
}
cout << ans << nl;
return 0;
}