#include<bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    unsigned long long n, m;
    cin >> n >> m;
    if(n == 1){
    	cout << m;
    	return 0;
    }
    else if(m == 1){
    	cout << n;
    	return 0;

    }
    unsigned long long redari = 2 * n + 2 * (m - 2);
    unsigned long long sredina_n = n - 2;
    unsigned long long sredina_m = m - 2;
    if(sredina_m % 2 == 0){
    	redari += (sredina_m / 2) * sredina_n;
    }
    else{
    	if(sredina_n % 2 == 0){
    		redari += (sredina_m / 2) * (sredina_n / 2);
    		redari += (sredina_m / 2 + 1) * (sredina_n / 2);
    	}
    	else{
    		redari += (sredina_m / 2 + 1) * (sredina_n / 2);
    		redari += (sredina_m / 2) * (sredina_n / 2 + 1);
    	}
    }
    cout << redari;
}