A=[i+1 for i in range(1000)]
A+=reversed(A)
A.insert(1000,1001)
while(1):
    try:
        n=int(raw_input())
        ans=0
        for i in range(n+1):
            if i<2001 and n-i<2001:
                ans+=A[i]*A[n-i]
        print ans
    except:
        break