import Control.Applicative
import System.IO
import Control.Monad
 
main = do
    n <- read <$> getLine
    putStrLn $ show $ sum $ [max 0 ((min (a+1) (2001-a) ) * (min (n-a+1) (2001 - n + a))) | a <- [0 .. min n 2000]]
    eof <- isEOF
    unless eof main