#include <iostream>
using namespace std;
int main(void){
    
    long long n,m;
    cin >> n >> m;
    
    cout << (n / m) / 1000 * 1000;
}