print((function (f, n) return f(n) end)(function (n) local t,s,c = math.floor(math.sqrt(n)),"%f%f",0 for i=1,t do if n%i == 0 then c = c + (s:format(n/i,i) == s:format(i,n/i) and 1 or 2) end end return c end, io.stdin:read("*n")))