class Problem0128:
    def solve(this):
        n = int(input())
        m = int(input())

        t = (n / m) // 1000
        print(int(t) * 1000)
if __name__ == "__main__":
    problem = Problem0128()
    problem.solve()