#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	long long n, m;
	cin>>n>>m;
	if(n==1){
		cout<<m;
		return 0;
	}
	if(m==1){
		cout<<n;
		return 0;
	}
	long long rez = 2*(n+m)-4;
	n-=2;
	m-=2;
	rez += (n*m)/2;
	cout<<rez; 
	return 0;
}