#include <bits/stdc++.h>

using namespace std;


int main() 
{
    ios::sync_with_stdio(false); 
    cin.tie(0);
    
    long long int N, M;

    cin >> N;
    cin >> M;

    cout << (N / (M * 1000)) * 1000LL << '\n';

    return 0;
}