n, m = map(int, input().split()) d = [0] * (n + 1) for i in range(1, m + 1): for j in range(i, n + 1, i): d[j] += i for i in range(n): d[i+1] += d[i] ans = max(x * m - d[x] for x in range(1, n + 1)) print(ans)