f=lambda n:n<2or int(`n`,22)%21+max(f(d-n%d*n)for d in range(1,n)) while 1:print+f(input())
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page