data_map = [0]*4001

for i1 in range(1001):
  for i2 in range(1001):
    for i3 in range(1001):
      for i4 in range(1001):
        data_map[i1+i2+i3+i4] += 1

while True:
  try:
    line = int(raw_input())
  except:
    break
  print data_map[line][3]