#include //#include using namespace std; //using namespace atcoder; using ll = long long; //using mint = modint998244353; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll N, M, x, l, r; cin >> N >> M; //v(x) = sum(i=1 to M) (x/i)*i vector v(N+2); for (int i=1; i<=M; i++){ x = N/i; for (int j=1; j<=x; j++){ //j*i~(j+1)*i-1にj*iを足す。 l = j*i; r = min((j+1)*i-1, (int)N); v[r+1] -= j*i; v[l] += j*i; } } ll ans=0; for (int i=1; i<=N; i++) v[i] += v[i-1]; for (int i=1; i<=N; i++){ ans = max(ans, M*i-v[i]); } cout << ans << endl; return 0; }