L=[0]*2001
for i in range(1001):
    for j in range(1001):
            L[i+j]+=1
while True:
    cnt=0
    try:
        n=input()
    except EOFError:
	break
    for i in range(1001):
        for j in range(1001):
            if 0<=n-i-j<=2000:
                cnt+=L[n-(i+j)]
    print cnt