#include <bits/stdc++.h>
#define S second
#define F first
#define int long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define yes "YES"
#define no "NO"
#define ent "\n"
#define rv reverse
#define fr(i,x,y) for(int i = x;i <= y;i++)
#define frr(i,x,y) for(int i = x;i >= y;i--)
using namespace std;


//made by Meirhan

void solve() {
	int n,m;
	cin>>n>>m;
	int ans = n * m;
	if(n % 2 == m % 2){
		cout<<ans * (ans + 1) / 2 + 2;
	}
	else{
		cout<<ans * (ans + 1) / 2 + 1;
	}
}

signed main() {
	//freopen ("bridges.in","r",stdin);
	//freopen ("bridges.out","w",stdout);
	int t = 1;
	//cin>>t;
	while(t--) {
		solve();
	}
}
