N, M = map(int, input().split()) x = min(M - 1, N) ans = 0 for i in range(1, M + 1): ans += x % i print(ans)