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