#include<bits/stdc++.h>
using namespace std;
int carps(int n, int m){
	if (n == 1 and m == 1) return 1;
	if (n == 1) return carps(n, m - 1) + carps(n, 1) + n * m;
	else return carps(n - 1, m) + carps(1, m) + n * m;
}
int main(){
	int n,m;
	cin >> n >> m;
	cout << carps(n, m);
}
	