#include #include int main(void){ long long n; long long m; int r=0; int i; int k=0; int q; char s[1000]; scanf("%lld",&n); scanf("%lld",&m); printf("%d",n/1000/m*1000); return 0; }