#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll donji(ll n)
{
    return n/2;
}
ll gornji(ll n)
{
    if(n%2==0) return n/2;
    else return n/2+1;
}
int main()
{
    ll n,m;
    cin>>n>>m;
    cout<<2*(m+n)-4+donji(m-2)*(n-2-donji(n-2))+gornji(m-2)*donji(n-2)<<endl;
}