#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define ppb pop_back
 
using namespace std;

ll h, w, ans;
ll c[300009];
map <ll, ll> mp;
vector <ll> vec;

int main()
{
    cin >> h >> w;
    ll x = h, y = w;
    while(x >= 1 && y >= 1){
        ans += (x*y) * ((h*w) / (x*y));
        x > y ? x-- : y--;
    }
    cout << ans;
}
