T = 1000
memo = [[0] * (2 * T + 1) for _ in range(3)] 
#Java: int[][] memo = new int[3][2*T+1];
memo[0][0] = 1
for i in range(1,3):
    for j in range(i*T+1):
        memo[i][j] = sum([memo[i-1][k] for k in range(max(0,j-T),j+1)])

while True:
    try:
        n = input() 
    except EOFError:
        break
    cnt = 0
    for a in range(T+1):
        for b in range(T+1):
            cnt += memo[2][n-(a+b)] if 0 <= n - (a + b) <= 2 * T else 0 
            # 0 <= n - (a + b) <= 2 * T ? memo[n-(a+b)] : 0
    print cnt

#O(T^2), 2.15s