a=int(input())//1000 b=int(input()) if b>a: print(0) else: print(a//b*1000)