#include <iostream>
using namespace std;
 
int main()
{
    int sum = 0;
    int h, w;
    cin >> h >> w;
    int ans;
    ans = h * w;
    for(int i = 0; i <= ans; i++){
        sum += i;
    }
    if(h == w){
        sum += 2;
        cout << sum;
        }else{
        cout << sum + 1;
        }
}