N=int(input()) M=int(input()) if (N//1000)%M == 0: print(N//M) if (N//1000)//M == 0: print(0) else: print(((N//1000)//M)*1000)