let rec solve acc i n =
  if n <= i * i then acc
  else
    solve
      ( acc +
        (if (n - i) mod i = 0 then (n - i) / i else 0) +
        (if (n / i) = (n mod i) then i else 0) ) (i + 1) n

let () = Scanf.scanf "%d" @@ fun n ->
  Printf.printf "%d\n" @@ solve (n - 1) 2 n