#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int N, M, redari=0;
    
    cin >> N >> M;
    
    redari+=2*M+(N-2)*2;
    
    N-=2;
    M-=2;
    
    switch(M%2){
        case 0: {redari+=N*(M/2); break;}
        case 1: {switch(N%2){
            case 0: {redari+=(N/2)*(M/2)+(N/2)*(M/2+1); break;}
            case 1: {redari+=(N/2)*(M/2+1)+(N/2+1)*(M/2); break;}
        }
            }
        
    }
    
    cout << redari;

    return 0;
}