// By ObeliX
#include <bits/stdc++.h>
#pragma GCC target( "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#include <unordered_map>
#include <cstddef>
#include <cassert>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <queue>
#include <map>
#include <set>

using namespace std;
const long long INF = 1e18;
const long long mod = 998244353;
const long long N = 1e6;
const long long M = 1e9 ;
const double eps = 1e-6; 
string alph = "abcdefghijklmnopqrstuvwxyz";
// ||

long long sum( long long n ) {
    return ( n * ( n + 1 ) ) / 2;
}

int main(){
    //freopen( "cinema.in" , "r" , stdin );
    //freopen( "cinema.out" , "w" , stdout );
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long h , w;
    cin >> h >> w;
    long long mx = max( h , w );
    long long mn = min( h , w );
    cout << ( sum(mx) - 1 ) * mn + ( sum(mn) + (mn - 1)) * mx;
} 
