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

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

figured it out … thanks

still getting wa with

no clue tried different cases …any ideas