#include using namespace std; typedef long long ll; typedef pair P; const int INF = 1e9; const int mod = 1e9+7; const double EPS = 1e-10; const double PI = acos(-1.0); int dp[11000] = {1}; int main() { ll n,m; cin >> n >> m; cout << n/1000/m*1000 << endl; return 0; }