#include <iostream>
using namespace std;

int main() {
int a, b;
cin >> a >> b;
int okolo = (a * 2) + ((b - 2) * 2);
int unutra = ((((a-2)*(b-2))-1)/2);
int red = okolo + unutra;
cout << red << endl;
  return 0;
}