#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%9!=0&&k%5!=0)||k!=0&&k