/*|Assalomu aleykum az nomi Safdar::
 _________       _____      ___                             _            _
|__     __|     /  _  \    |   |               /\          | \          / |
   |   |       /  / \__\   |   |              /  \         |  \        /  |
   |   |       |  |        |   |             /    \        |   \      /   |
   |   |       \  \___     |   |            /  /\  \       |    \    /    |
   |   |         \__  \    |   |           /  /__\  \      |     \  /     |
   |   |       __   \  |   |   |____      /   ____   \     |   |\ \/ /|   |
 __|   |__    \  \__/  |   |        |    /  /      \  \    |   | \  / |   |
|_________|    \______/    |________|   /__/        \__\   |___|  \/  |___|s
 */
#include<bits/stdc++.h>
using namespace std;
#define in freopen ("input.txt", "r", stdin);
#define out freopen("output.txt", "w", stdout);
#define ll long long
 
bool prime(long long  s)
{
    for (int i=2;i<=sqrt(s);i++)
    {
        if (s%i==0)
        {
            return false;
        }
    }
    return true;
}
string toBinary(int n)
{
    string r;
    while(n!=0)
    {
        if(n%2==0)
        {
            r+='0';
            n/=2;
        }
        else
        {
            r+='1';
            n/=2;
        }
    }
    return r;
}
void Safdar()
{
     long long a,b;
    cin>>a>>b;
    long double cnt=0;
    if(a>=b){
      for(int i=a;i>=1;i--){
        cnt+=abs(i);
      }
      cnt+=(a-1);
      cnt*=b;
      if(a==1 or  b==1){
        cout<<fixed<<setprecision(0)<< cnt;
        return;
      }
      cnt+=(a*b);
      cout<<fixed<<setprecision(0)<< cnt;
    }
    else{
      for(int i=b;i>=1;i--){
        cnt+=abs(i);
      }
      cnt+=(b-1);
      cnt*=a;
      if(a==1 or  b==1){
      cout<<fixed<<setprecision(0)<< cnt;
        return;
      }
      cnt+=(a*b);
      cout<<fixed <<setprecision(0)<< cnt;
    }
     
}
int main()
{
    // in out  if ((ar[i][j]=='#' and ar[i+1][j+1]=='#' and i<9 and j<9) or (ar[i][j]=='#' and ar[i-1][j-1]=='#' and i>0 and j>0) or (ar[i][j]=='#' and ar[i+1][j-1]=='#' and i<9 and j>0) or (ar[i][j]=='#' and ar[i-1][j+1]=='#' and j<9 and i>0))
    ios_base::sync_with_stdio(0);
    int t=1;
    // cin>>t;
    while (t--)
    {
        Safdar();
    }
}