let n = read_int ()
let n' = int_of_float (sqrt (float_of_int n)) + 1

let rec solve k ans =
  if k = n' then ans
  else
    let k' = n / k in
    let f = k' * k' + k' - k * k in
    solve (k + 1) (ans + k * f)

let () = Printf.printf "%d\n" (solve 1 0)
