for(s=readline(i=99),t=9+!+s+'';i;)t+=~(s[s[-1]-i--]+0)[0]-~(+s&&9+!i);print(t)
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page