#include int main(void) { long int n; int m; scanf("%ld %d",&n,&m); printf("%d\n",(n/(1000*m))*1000); return 0; }