N,M=map(int,input().split()) ans=(N//(M*1000))*1000 print(ans)