PALIN getting WA

Hello everyone ,
I am getting WA for PALIN i have tested with multiple cases . any corner case would be great
Here is my solution
http://www.codechef.com/viewsolution/3930317
Thanks

Try single digit numbers.
for 1 ans is 2
but your output is still 1

figured it out … thanks

still getting wa with CodeChef: Practical coding for everyone

no clue tried different cases …any ideas