#include <bits/stdc++.h>
#define pb push_back
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define ll long long
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<m)swap(n,m);
    if(n<=2 || m<=2)cout<<n*m;
    else cout<<(n-1)*2+(m-1)*2+((n-2)-(n-2)/2)*((m-2)/2)+((n-2)/2)*((m-1)/2);
	return 0;
}