//#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;
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 == 1 && m == 1){
		cout << 1;
		return 0;
	}
	if (n == 1 && m == 2){
		cout << 4;
		return 0;
	}
	if (n == 2 && m == 1){
		cout << 4;
		return 0;
	}
	a = n * m;
	b = a;
	for (int i = 1; i <= n; i++){
		a += (n / i * i * m);
	}
	for (int i = 1; i <= m; i++){
		b += (m / i * i * n);
	}
	cout << max (a, b);
}
