#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int mxN=2e5+5;
LL n,m;
int main()
{
    scanf("%lld %lld", &n, &m);
    if(n>m){
        swap(n,m);
    }
    if(n==1){
        printf("%lld",m);
    }
    else{
        LL obim=m*2+(n-2)*2;
        n-=2;
        m-=2;
        LL x=n/2;
        LL y=n-x;
        LL ans=obim+(m/2)*y+(m-m/2)*x;
        printf("%lld", ans);
    }
    return 0;
}