#include using namespace std; int main() { long long n; int m; cin >> n >> m; int i; for (i = 0; n >= 1000 * m; ++i) { n -= 1000 * m; } cout << i * 1000 << endl; }