#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;
	long long rez = 2*(n+m)-4;
	n-=2;
	m-=2;
	rez += (n*m)/2;
	cout<<rez; 
	return 0;
}