#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
 
int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	ll n,m; cin >> n >> m;
	cout << n/m/1000*1000 << endl;
}