#include #include #include #include int manp(const void *a,const void *b){ return *(char *)b-*(char *)a; } int main(void) { int n,k; scanf("%d%d",&n,&k); if(n%2==0){ if(k%2==0){ if(k!=0&&k<=n&&(k!=1&&n!=1)){ printf("%d\n",n-2); }else{printf("0\n");} }else{ if(k!=0&&k<=n&&(k!=1&&n!=1)){ printf("%d\n",n-2); }else{ printf("0\n"); } } }else{ if(k%2==0){ if((k!=0&&k