import sys

p = [0] * 4001
v = 0
for i in range(2001):
    t = (i+3)*(i+2)*(i+1)//6
    v = v + 2 * (i-999) * (i-1000) if i > 1000 else 0
    p[i] = t - v
    p[4000-i] = p[i]

for i in sys.stdin:
    print(p[int(i)])