#include<bits/stdc++.h>
using namespace std;
int rec(int a, int b, int sm){
    sm += a * b;
    if(a == 1 && b == 1) return sm;
    if((a - 1) * b < (b - 1) * a) swap(a, b);
    return sm + rec(a - 1, b, 0) + rec(1, b, 0);
}
int main(){
    int h, w;
    scanf("%d %d", &h, &w);
    cout<<rec(h, w, 0);
}