#include int main(void) { int a,b; scanf("%d%d",&a,&b); printf("%d",a/1000/b*1000); return 0; }