Scanf.scanf "%d" (fun n ->
    let rec loop i acc =
        if i > n then acc else
            let q = n / i in
            let acc = acc + i * q * (q + 1) / 2 in
            loop (i + 1) acc
    in
    loop 1 0 |> Printf.printf "%d\n"
)