#include int main() { int l,k,c,i; scanf("%d%d",&l,&k); while(1){ if((l-k*2)<=0){ break; } l-=k*2; c+=k; } printf("%d\n",c); return 0; }