#include <iostream>

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