import sys
for line in sys.stdin.readlines():
  n = int(line.rstrip())
  count = 0
  for i in range(1001):
    if 0 <= n - i <= 1000:
      count += (n-i+1)*(i+1)
    elif 1000 <= n-i:
      count += (2000-(n-i)+1)*(i+1)
  for i in range(1001,2001):
    if 0 <= n - i <= 1000:
      count += (n-i+1)*(2000-i+1)
    elif 1000 <= n-i:
      count += (2000-(n-i)+1)*(2000-i+1)
  print(count)