#include <time.h>
#include <cstdlib>
#include <stack>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <map>
#include <set>
#include <iterator>
#include <deque>
#include <queue>
#include <sstream>
#include <array>
#include <string>
#include <tuple>
#include <chrono>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <list>
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <bitset>
#define ll long long
using namespace std;

int tt = 1, h, w;
ll ans, cnt;
ll kol = 1;
void rec(ll x){
    cnt += x;
    if(x == 1) return;
    ll l = x / 2, r = x - x / 2;
    rec(l);
    rec(r);
}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    cin >> h >> w;
    if(h != 1 && w != 1)
    ans = ans + (h * w);
    while(h > 1 && w > 1){
        if(h % 2 == 0){
            kol *= 2;
            h /= 2;
            continue;
        }
        if(w % 2 == 0){
            kol *= 2;
            w /= 2;
            continue;
        }
        if(h > 1){
            h--;
            rec(w);
            ans = ans + cnt * kol;
            cnt = 0;
            continue;
        }
        if(w > 1){
            w--;
            rec(h);
            ans = ans + cnt * kol;
            cnt = 0;
            continue;
        }
    }
    rec(max(h, w));
    cout << ans + cnt * kol;
}
