#include <bits/stdc++.h>
#define ll long long
#define fr first
#define sc second
#define ll long long int
#define ld long double
#define mup unordered_map
#define pb push_back
#define pf push_front
#define fr first
#define sc second
#define NeedForSpeed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);srand(time(0)) ;
#define p_b pop_back
#define p_f pop_front
#define quluq return 0;
#define NO cout << "NO\n"
#define no cout << "no\n"
#define No cout << "No\n"
#define Yes cout << "Yes\n"
#define YES cout << "YES\n"
#define yes cout << "yes\n"
using namespace std;

void flfl() {
    ll a , b , z , x , q = 0 , w = 0 ;
    cin >> a >> b ;
    if ( b>a )
        swap(a,b) ;
    z = a , x = b ;
    ll ans = a*b ;
    q += a ;
    while ( a-1 > 0 ) {
        q += a-1 ;
        q ++ ;
        a -- ;
    }
    if ( x == 1 ) {
        cout << q << endl ;
        return ;
    }


    while ( x-1 > 1 ) {
        x -- ;
        w += x*z ;
    }




    cout << w+ans+q*b << endl ;
}

int main() {
    NeedForSpeed
    int t = 1 ;
    while ( t -- ) {
        flfl() ;
    }
}
