#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("sse,sse2,sse3,sse4,sse4.1,sse4.2,abm,bmi,bmi2,popcnt,lzcnt,avx,avx2,fma")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stack>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <time.h>
#include <deque>
#define ll long long
using namespace std;
using loh = long long; // loh
using flag = bool;
using lohd = long double; // short (4bite) // dolik loh

int main () {
	ios_base::sync_with_stdio (0);
	cin.tie (0);
	cout.tie (0);
	loh n, m;
	cin >> n >> m;
	cout << m * (n + 2) * (n - 1) / 2 + n * (m - 1) * (m + 2) / 2 + n * m;
}