#include <bits/stdc++.h>
 
#define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define int long long
 
const int maxn = 2e5+7;
const int inf = 1e18;
const int mod = 1e9+7;
  
using namespace std;

int ans;

int rec(int h, int w){
	if(w != 1){
		return rec(h, w - 1) + rec(h, 1) + h * w;
	}else if(h != 1){
		return rec(h - 1, w) + rec(1, w) + h * w;
	}
	return 1;
}

void solve(){
	int h, w;
	cin >> h >> w;
	cout << rec(h, w);
}
 
signed main(){
    speed
    int test = 1;
    // cin >> test;
    while(test--){
        solve();
    }
}