#include <iostream>

using namespace std;

long long n,m;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>m;
    if(n==1)
    {
        cout<<m;
        return 0;
    }
    if(m==1)
    {
        cout<<n;
        return 0;
    }
    long long ivice=2*(n+m)-4;
    long long unutra=n*m-ivice;
    cout<<ivice+unutra/2;

    return 0;
}