hi
in the reference a int is descriped as 4 byte storage datatype. but consider, we are not on a 32 bit platform with the arduino board. so the int space is only 2 byte, means a range from -32768 to +32767. when you add 1 to a int value from 36767, the int overflows to -32768
just good to know when an unexpected state occurs with a variable/counter...