import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines x,y = map(int,read().split()) x //= 1000 answer = (x // y) * 1000 print(answer)