#include using namespace std; #define ll long long int main(){ ll n, m, res = 0; cin >> n >> m; if(n/m < 1000){ cout << 0 << endl; }else{ res = (n/m) / 1000 * 1000; cout << res << endl; } return 0; }