#include int main(int argc, const char * argv[]) { int N; int M; scanf("%d",&N); scanf("%d",&M); printf("%d\n",N/1000/M*1000); return 0; }