#include <iostream>

using namespace std;
long long f(long long n, long long m)
{
    if(n%2==1&&m%2==1)
        return (n*m-1)/2;
    return n*m/2;
}
int main()
{
    long long n, m;
    scanf("%lld%lld", &n, &m);
    long long x=2*(m+n-2);
    x+=f(n-2, m-2);
    if(n==1)
        printf("%lld", m);
    else if(m==1)
        printf("%lld", n);
    else
        printf("%lld", x);
    return 0;
}