#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    ll n,m;
    cin >> n >> m;
    if (n==1 || m==1)
    {
        cout << n*m << "\n";
        return 0;
    }
    cout << n*m-(n-2)*(m-2)+((n-2)*(m-2))/2 << "\n";
    return 0;
}