#include <iostream>

using namespace std; 

int main() {
    
    ios_base::sync_with_stdio(false); 
    cin.tie(0); 
    cout.tie(0); 
    
    int n, m; 
    
    cin>>n>>m; 
    
    int n2 = n-2; 
    int m2 = m-2; 
    
    int n2i = (n2/2) + (n2%2);
    
    int b1 = m2/2; 
    int b = (m2+1)/2; 
    
    int o = ((n2/2) * b1) + (n2i * b); 
    int r = 2*n + 2*m - 4 + o - 1; 
    
    cout<<r; 
    
    return 0; 
    
}