Wrong Answer

Problem CNDY
In line 15, why using int give different answer than simply writing count ?