#include using namespace std; #define ll long long int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N, M; cin >> N >> M; if (N < M * 1000) { cout << "0" << "\n"; return 0; } ll T; T = (N + M - 1) / M; for (int i = T; i >= 0; i--) { if (i * 1000 * M <= N) { cout << i * 1000 << "\n"; break; } } return 0; }