N, M = map(int, input().split()) ans = [] for n in range(1, N+1): ans.append(n*max(M-n, 0)) for i in range(2, len(ans)): ans[i] += (1+(i-1))*(i-1)//2 if i > M: diff = i-M ans[i] -= (1+diff)*diff//2 imos = [0]*N for m in range(2, M+1): for n in range(2, 10**18): if m*n > N: break imos[m*n-1] += m for i in range(1, N): imos[i] += imos[i-1] for i in range(N): ans[i] -= imos[i] print(max(ans))