#include using namespace std; int main() { int L,K;scanf("%d %d",&L,&K); int cajiru=L%(2*K); if(cajiru==0)cajiru=2*K; printf("%d\n",(L-cajiru)/2); }