import sys



n=1001

a=[0]*2001

for i in range(n):

  for j in range(n):

    a[i+j]+=1

for n in map(int,sys.stdin):

  x=0

  for i in range(max(0,n-2000),min(n,2000)+1):

    x+=a[i]*a[n-i]

  print(x)
import sys

n=1001

a=list(range(1,n))

a+=[n]+a[::-1]

for n in map(int,sys.stdin):

  x=0

  for i in range(max(0,n-2000),min(n,2000)+1):

    x+=a[i]*a[n-i]

  print(x)
import sys

n = 1001
a = [0] * 2001
for i in range(n):
    for j in range(n):
        a[i + j] += 1
for n in map(int, sys.stdin):
    x = 0
    for i in range(max(0, n - 2000), min(n, 2000) + 1):
        x += a[i] * a[n - i]
    print(x)

import sys

n = 1001
a = list(range(1, n))
a += [n] + a[::-1]
for n in map(int, sys.stdin):
    x = 0
    for i in range(max(0, n - 2000), min(n, 2000) + 1):
        x += a[i] * a[n - i]
    print(x)

-a = [0] * 2001 -for i in range(n): -    for j in range(n): -        a[i + j] += 1 +a = list(range(1, n)) +a += [n] + a[::-1]