//#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define all(x) x.begin(), x.end()
#define sz(x) x.size()
#define forik(x) ll i = 1; i <= x; i++

const int mod = 1e9 + 7;

using namespace std;

ll t, n, m, a, b, c, d, e, used[11][11],sum,p;
string s;
map <ll, ll> mp;
vector <ll> g;

signed main (){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cin >> n >> m;
	if (n < m){
		swap (n, m);
	}
	for (int i = 1; i <= n; i++){
		ll l = 1, r = 1e6;
		while (l <= r){
			ll md = (l + r) / 2;
			if (md * i < n){
				l = md + 1;
			}
			else{
				r = md - 1;
			}
		}
		if (l * i > n){
			l--;
		}
//		cout << l << ' ' << i << '\n';
		a += l * i;
	}
//	cout << a << ' ';
	a *= m;
	if (n != 1 && m != 1) a += n * m;
	cout << a;
}
