two_dict = {}
for i in range(2001):
  two_dict[i] = min(i, 2000 - i) + 1 

while True:
  try:
    n = int(input())
    ans = 0
    for i in range(n + 1):
      ans += two_dict[i] * two_dict[n - i]
    print(ans)

  except EOFError:
    break

