#include<iostream>
#include<cassert>
#define rep(i,n) for(i=0;i<(int)(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

ll n;
int m;

int main(){
    scanf("%lld%d",&n,&m);
    printf("%lld\n",1000*((n/1000)/m));
    return 0;
}