N = int(input()) M = int(input()) ans = (N//M)//1000 ans *= 1000 print(ans)