#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,m;
    cin>>n>>m;
    if(n==1){
        if(m%2==0)
            cout<<m/2+1;
        else cout<<m/2;}
    if(m==1){
        if(n%2==0)
            cout<<n/2+1;
        else cout<<n/2;}
    
    if(n%2==0 || m%2==0)
    cout<<2*m+2*(n-2)+(n-2)*(m-2)/2-2;
    else cout<<2*m+2*(n-2)+(n-2)*(m-2)/2;
    return 0;
}