#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    ll h,w;
    cin>>h>>w;
    if(h==1 and w==1) cout<<1;
    else cout<<(int)log2(w*h)*w*h+min(w,h)*(max(w,h)*(max(w,h)+1)/2-1);
	}
