#include<stdio.h>

int main()

int n,k,result;

printf(Enter the number of balls:");
scanf("%d",&n);

printf("Enter the number of persons:");
scanf("%d",&k);

if(k<=1)

{
result=0;

}else
{
result=n-k-1;
}

printf("The difference is %d",result);

return 0;
}