#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n,m,ans; cin>>n>>m; ans=n/m/1000*1000; cout<<ans<<endl; }