#include <bits/stdc++.h>

#define ll long long
#define ld long double
#define ull unsigned long long
#define K 1000001
using namespace std;
ull gay;
ull rec(ull x){
    if(x==1) return gay;
    if(x%2) return gay + 2*rec(x-1);
    else return 2*rec(x/2);
}

void MAIN() {
    ull a,b;
    cin>>a>>b;
    if(a==1 && b==1){
        cout<<1;
        return;
    }
    if(b>a){
        ull temp = a;
        a = b;
        b = temp;
    }
    ull dp[a+1];
    dp[1] = 1;
    dp[2] = 4;
    dp[3] = 8;
    dp[4] = 13;
    for(int i=5;i<=a;i++){
        dp[i] = dp[i-1] + 1 + i;
    }
    if(b==1){
        cout<<dp[a];
        return;
    }
    gay = dp[a];
    ull cc = rec(b) + a*b;
    cout<<cc;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    ll T = 1; //cin >> T;
    while (T--) MAIN();
    return 0;
}
