import sys
ab=[0 for _ in range(2001)]
for a in range(1001):
    for b in range(1001):
        ab[a+b]+=1
for l in sys.stdin:
    n=int(l[:-1])
    ans=sum(ab[i]*ab[n-i] for i in range(2001) if 0<=n-i<=2000)
    print(ans)
