#include <iostream>
using namespace std;

long long solve(long long n, long long m){
    if(n*m == 1)
        return 1;

    int a = max(n, m);
    m = min(n, m);
    n = a;

    if(n % 2 == 0)
        return(n*m)+2*solve(n/2, m);
    else
        return(n*m)+solve(n/2+1, m)+solve(n/2, m);
}

int main(){
    long long n, m;
    cin >> n >> m;
    cout << solve(max(n, m), min(n, m));
    return 0;
}