#include <bits/stdc++.h>
using namespace std;
#define int long long

long long rec(long long a, long long b){
    if(a == 1 && b == 1){
        return 1;
    }
    if(a > b && a % 2 == 0){
        return a * b + 2 * rec(b, a/2);
    }
    if(b >= a && b % 2 == 0){
        return a * b + 2 * rec(b/2, a);
    }
    if(a > b){
        return a * b + rec(b, a/2) + rec(b, a - a/2);
    }
    return a * b + rec(b/2, a) + rec(b - b/2, a);
}

signed main(){
    long long h, w;
    cin >> h >> w;
    cout << rec(h, w);
}
