#include using namespace std; using ll = long long; int main() { ll n, k; cin >> n >> k; n/=1000; cout << n/k*1000<