why i am getting wrong answer ?

Problem : http://www.codechef.com/problems/ACUPALIN

My Solution : http://www.codechef.com/viewsolution/6469499