// yukicoder 128 (http://yukicoder.me/problems/130) #include typedef long long ll; ll N, M; int main() { scanf( "%lld%lld", &N, &M ); printf( "%lld\n", N/M/1000*1000 ); return 0; }