#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <cassert>
#include <random>
#include <chrono>
#include <tuple>

#pragma GCC optimize("03")
#pragma GCC target("avx2")

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using ii = int;

using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll h, w; cin >> h >> w;
    if (h < w) {
        swap(h, w);
    }
    cout << w * (4 + (h - 2) + (((3 + h) * (h - 2)) / 2)) + h * (((2 + w) * (w - 1)) / 2);
    /*if (h < w) {
        swap(h, w);
    }
    vector<vector<ll>> dp(h + 1, vector<ll>(h + 1, 0));
    dp[1][1] = 1;
    for (ii i = 1; i <= h; i++) {
        for (ii j = 1; j <= min(i, w); j++) {
            if (dp[i][j]) continue;
            dp[i][j] = i * j + dp[i - 1][j] + dp[1][j];
            dp[j][i] = dp[i][j];
        }
    }
    cout << dp[h][w];*/
    return 0;
}