#include using namespace std; int main() { long a, b, c, d = 0; cin >> a >> b; if ((a / b) % 1000 != 0) c = a / b - (a / b) % 1000; else c = a / b; for (long i = 0; i < c/1000; i++) { d += 1000; } cout << d; return 0; }