#include<stdio.h>
main(){
    long long N,M;
    scanf("%lld %lld",&N,&M);
    N /= 1000LL;
    printf("%d",N/M*1000LL);
}