#include <bits/stdc++.h>
using namespace std;
using namespace std;
typedef long long ll;
typedef vector <int> vi;
typedef pair <int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
#define A first
#define B second
#define PB push_back
#define MP make_pair
#define PF push_front
#define all(v) v.begin(),v.end()
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);


int main()
{
    FAST
    ll n,m;
    cin>>n>>m;
    if(n==1 || m==1) cout<<max(m,n);
    else
    {
        int br=(n-2)*(m-2)/2;
        if(n%2==1 && m%2==1) br++;
        cout<<n*m-br;
    }
    return 0;
}