#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long
#define pb push_back
#define pii pair<int, int>
#define vii vector<int>
#define mp make_pair
#define FOR(i, n) for (int i = 0; i < n; ++i)
#define INF 0x3f3f3f3f
const vector<pair<int, int>> nb = {{-1, -1}, {-1, 1}, {1, 1}, {1, -1}, {-1, 0}, {1, 0}, {0, 1}, {0, -1}};
const vector<pair<int, int>> nc = {{-1, 0}, {1, 0}, {0, 1}, {0, -1}};
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) { return (a.second < b.second); }
const int maxN = 1e6;

ll n,m;


void solve(){
	ll ans = (2*n)+2*(m-2);
	n-=2;
	m-=2;
	ans+=((n/2)+1)*(m/2);
	ans+=(n/2)*((m/2)+1);
	cout<<ans<<"\n";
}



int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n>>m;
	solve();
	return 0;
}