import Data.List
main=print.f=<<readLn
f n=length.group.sort$a++filter(g n)b where
  [a,b]=map(d[]2)[n-1,n]
g n i=case n`mod`i of
  0 -> g(n`div`i)i
  1 -> True
  _ -> False
d r i m
  |i*i>m=if m>1 then m:r else r
  |m`mod`i==0=d(m`div`i:i:r)(i+1)m
  |otherwise=d r(i+1)m