#include #include #include #include #include #include #define REP(a,b) for(int a=0; a<(int)b; a++) using namespace std; int main(){ int N, M; cin >> N >> M; N /= 1000; cout << N/M*1000 << endl; return 0; }