#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    long long n,m;
    cin >> n >> m;
    long long br = 0;
    bool nastavi = false;
    if(m==1){
        br = n;
    }else if(n==1){
        br = m;
    }else{
        br = 2*n + (m-2)*2;
        nastavi = true;
    }
    if(nastavi){
        long long p = n-2;
        long double f = p/2.;
        long long l = m-2;
        long double k = (p-1)/2.;
        long long br1=0;
        long long br2=0;
        br1=l/2;
        br2=(l+1)/2;
        br=br+(br1*(ceil(f)))+(br2*(ceil(k)));
    }
    cout << br;
    return 0;
}