n = int(input()) m = int(input()) money = n//m//1000 print(money*1000)