#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,m;
    cin >> n >> m;
    if (n<3 || m<3)
    {
        cout << n*m;
        return 0;
    }
    if (n%2==0)
    {
        cout << (m+n-2)*2+((n-2)/2)*((m-1)/2+(m-2)/2);
        return 0;
    }
    cout << (m+n-2)*2+((n-3)/2)*((m-1)/2)+(n-1)/2*((m-2)/2);
    return 0;
}