You have reached the maximum number that an
int can represent. That is 32767.
int is a variable type that is made up of 16 bits. It is signed, meaning that it can represent positive and negative numbers.
Out of the 65536 (ie. 2^16) possible numbers from the 16 bits, half of them represent negative numbers and the remaining half represents positive numbers (including zero). Or in other words, -32768 to 32767.
If you don't need negative numbers, then you can change your variable type to
unsigned int which will use numbers up to a maximum of 65535. So it becomes:
unsigned int count = 0;