T = 1000
def f(x):
    return max(0, T + 1 - abs(T - x))
while True:
    try:
        n = input() 
    except EOFError:
        break
    cnt = 0
    for i in range(n):
        cnt += f(i) * f(n-i)
    print cnt

#O(n), 