import sys input = sys.stdin.readline N,M=map(int,input().split()) score=0 for i in range(1,M+1): score+=N%i print(score)