#!/usr/bin/python n = int(raw_input()) m = int(raw_input()) print n / 1000 / m * 1000