
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;

int f(int a,int count){
    if(a==0){
        return count;
        
    }
    count+=a+1;
    return f(a-1,count);
}
int main()
{
    int a,b;
    cin>>a>>b;
    if(b>a){
        swap(a,b);
    }
    if(a!=0&&b!=1){
        cout<<(f(a-1,0)+a)*b + a*b;
    }
    else{
        cout<<(f(a-1,0)+a)*b;
    }
    
}