import math n = int(input()) m = int(input()) div = n//(m*1000) print(((m*1000)*div)//m)