/*Shapaloki_Ochagi*/
#include "bits/stdc++.h"

using namespace std;

#define int long long
using ld = long double;
using str = string;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int n, m;
    cin >> n >> m;

    int ans = n * (m + 1) * m; ans /= 2;
    int k = m * n * (n + 1); k /= 2;
    int z = (n - 1) * m - n;

    std::cout << k + ans + z;
    return 0;
}

























//Imron_gay