solver2::Int->Int
solver2 n = (sum.(map (\ i -> (div n i) - 1)).(filter (\ i -> (mod n i  == 0) && (div n i) > (i+1) )).(takeWhile (\i -> i^2 <= n))) [1..]

main::IO()
main=do
  n<-return.read=<<getLine
  print (solver2 n)