import sys

a = range(1,1001) + range(1001,0,-1)
for s in sys.stdin:
    n = int(s)
    r = 0
    for i in range(min(2000,n),-1,-1):
        if n - i <= 2000:
            r += a[i] * a[n - i]
    print r