T = 1000

N = 4000

dp = [[0] * (N + 1) for _ in range(5)] 

#Java: int[][] dp = new int[5][N];

dp[0][0] = 1

for i in range(1,5):

    for j in range(i*T+1):

        dp[i][j] = sum([dp[i-1][k] for k in range(max(0,j-T),j+1)])



while True:

    try:

        n = eval(input()) 

    except EOFError:

        break

    print(dp[4][n])



#O(T^2), 0.954
T = 1000

def f(x):

    return max(0, T + 1 - abs(T - x))

while True:

    try:

        n = eval(input()) 

    except EOFError:

        break

    cnt = 0

    for i in range(n+1):

        cnt += f(i) * f(n-i)

    print(cnt)



#O(n), 
T = 1000
N = 4000
dp = [[0] * (N + 1) for _ in range(5)]
# Java: int[][] dp = new int[5][N];
dp[0][0] = 1
for i in range(1, 5):
    for j in range(i * T + 1):
        dp[i][j] = sum([dp[i - 1][k] for k in range(max(0, j - T), j + 1)])
while True:
    try:
        n = eval(input())
    except EOFError:
        break
    print(dp[4][n])
# O(T^2), 0.954

T = 1000


def f(x):
    return max(0, T + 1 - abs(T - x))


while True:
    try:
        n = eval(input())
    except EOFError:
        break
    cnt = 0
    for i in range(n + 1):
        cnt += f(i) * f(n - i)
    print(cnt)
# O(n),

-N = 4000 -dp = [[0] * (N + 1) for _ in range(5)] -# Java: int[][] dp = new int[5][N]; -dp[0][0] = 1 -for i in range(1, 5): -    for j in range(i * T + 1): -        dp[i][j] = sum([dp[i - 1][k] for k in range(max(0, j - T), j + 1)]) + + +def f(x): +    return max(0, T + 1 - abs(T - x)) + + -    print(dp[4][n]) -# O(T^2), 0.954 +    cnt = 0 +    for i in range(n + 1): +        cnt += f(i) * f(n - i) +    print(cnt) +# O(n),