import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  let
    f :: Int -> Int -> Int
    f i j = i * ((j - i) * (j + i) + j)
  n <- unsafeTextToInt <$> T.getLine :: IO Int
  print . sum . map (uncurry f) . takeWhile (uncurry (<=)) . map ((,) <$> id <*> div n) $ [1..]

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInt #-}
