TLE in SPAMCLAS

I am getting TLE in this question but there is no loop exceding the time!
Problem:- SPAMCLAS Problem - CodeChef
Solution:- CodeChef: Practical coding for everyone