def Main(): n=int(input())//1000 m=int(input()) print(n//m*1000) Main()