#include<bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
    ll w = 1e6, h = 1e6;
    cin >> h >> w;
    ll ans = h * w;
    if(w < h) swap(w, h);
    if(h == 1)
        ans = 0;
    for(ll l = w; l >= 1; --l)
        ans += w / l * h * l;
    cout << ans << '\n';
}
