import scala.io.Source.stdin
import scala.math.{max,min}

object Main extends App {

  val p = (
      for (i <- (0 to 2000) ++ (1999 to 0 by -1)) yield (i+3)*(i+2)*(i+1)/6 - max(2*(i-1000)*(i-999)*(i-998)/3,0)
  )

  stdin.getLines.foreach { x => println(p(x.toInt)) }
}