/*
TASK: rtri
LANG: C++
*/
#include <iostream>
#include <vector>
using namespace std;
long long fnk(int numP)
{
    if (numP == 2) return 0;
    if (numP == 3) return 3;
    vector <bool> used(100000, 0);
    int i, j, k;
    long long cnt = 0;
    for (i=0;i < numP;i++)
     for (j=i+1;j < numP;j++)
      if (i != j)
       for (k=j+1;k < numP;k++)
        if (k != i && k != j)
         if (!used[i+j+k])
         {cnt++; used[i+j+k] = true;}
    
    return cnt;
}
long long fnk1(int numP)
{
    if (numP == 2) return 0;
    if (numP == 3) return 3;
    int i, j, k;
    long long cnt = 0;
    for (i=0;i < numP;i++)
     for (j=0;j < numP;j++)
      if (i != j)
       for (k=0;k < numP;k++)
        if (k != i && k != j)
         cnt++;
    
    return cnt;
}

int main()
{
    int w, h;
    cin >> h >> w;
    //w = 5; h = 5;
    
    int numP = (w + 1) * (h + 1);
    long long cnt = fnk(numP);
    //cout << numP << endl;
    //cout << cnt << endl;
    
    long long fact_h = fnk1(h + 1), fact_w = fnk1(w + 1); 
    cnt -= (h*fact_h + w*fact_w);
    
    cout << cnt << endl;
    //cout << clock() << endl;
    //cout << fnk(5) << endl;
    //system("pause");
    return 0;
}
