import sys

a=[0]*2001

b=[0]*4001

n=1001

for i in range(n):

  for j in range(n):

    a[i+j]+=1

n=2001

for i in range(n):

  for j in range(n):

    b[i+j]+=a[i]*a[j]

for i in sys.stdin:

  print(b[int(i)])
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

a = [0] * 2001
b = [0] * 4001
n = 1001
for i in range(n):
    for j in range(n):
        a[i + j] += 1
n = 2001
for i in range(n):
    for j in range(n):
        b[i + j] += a[i] * a[j]
for i in sys.stdin:
    print(b[int(i)])

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)

+n = 1001 -b = [0] * 4001 -n = 1001 -n = 2001 -for i in range(n): -    for j in range(n): -        b[i + j] += a[i] * a[j] -for i in sys.stdin: -    print(b[int(i)]) +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)