n, m = map(int, input().split()) imos = [0] * (n + 10) for i in range(2, m + 1): for j in range(0, n + 1, i): imos[j + 1] += 1 if j + i + 1 < n + 10: imos[j + i] -= i imos[j + i + 1] += i - 1 for i in range(1, n + 2): imos[i] += imos[i - 1] for i in range(1, n + 2): imos[i] += imos[i - 1] print(max(imos[1 : n + 1]))