local f,r=math.floor,io.read print(f(f(r('*n')/(r('*n')))/1000)*1000)