w, d = int(input()), int(input()) for i in range(d, 0, -1): today = w // (i * i) w -= today if i == 1: print(today)