#include<bits/stdc++.h>
int main()
{
    long long int a, b;
    scanf("%lld%lld", &a, &b);
    if (a == 1 || b == 1) printf("%lld", a*b);
    else printf("%lld", 2*(a-1) + 2*(b-1) + ((a-2)*(b-2))/2);
    return 0;
}