import sys

n_list = []
while True:
    try:
        n_list.append(int(input()))
    except:
        break
for n in n_list:
    sum_list = list(range(1, 1001)) + list(range(1001, 0, -1))
    ans = 0
    for i in range(min(n+1, 2001)):
        if 0<= (n-i) <= 2000:
            ans += sum_list[i]*sum_list[n-i]
    print(ans)

