#include int main(void){ int L,K,S=0,D; scanf("%d %d",&L,&K); while(L-2*K>0){ L=L-2*K; S+=K; } printf("%d\n",S); return 0; }