N, M = map(int, input().split()) K = 505050 ans = [0] * K for i in range(2, M + 1): for j in range(0, N + 1, i): ans[j] += 1 ans[j + i - 1] -= i ans[j + i] += i - 1 for i in range(K - 1): ans[i + 1] += ans[i] for i in range(K - 1): ans[i + 1] += ans[i] print(max(ans[:N]))