s = list(range(1,1001)) + list(range(1001,0,-1))
while True:
    try:
        n = int(input())
    except:
        break

    ans = 0
    for i in range(min(n+1,2001)):
        if 0 <= n-i <= 2000:
            ans += s[i] * s[n-i]
    print(ans)
