#include <iostream>

using namespace std; 

int main () {
    
    ios_base::sync_with_stdio(false);
    cout.tie(0); 
    cin.tie(0); 
    
    long long n, m; 
    long long s, k; 
    
    cin>>n>>m; 
    
    s = n - 2; 
    k = m - 2;

    long long r = n*2 + m*2 - 4 + ((s/2) + (s%2)) * (k/2) + (s/2) * ((k/2) + (k%2)); 
    
    cout<<r; 
    
    return 0; 
    
}