# AOJ 0096 Sum of 4 Integers II
# Python3 2018.6.15 bal4u

MAX = 1000

while True:
	try: n = int(input())
	except: break
	
	if n > 2*MAX: n = 4*MAX - n
	k = n+1
	ans = k*(k+1)*(k+2)//6
	if n > MAX:
		k = n-MAX
		ans -= 2 * k*(k+1)*(k+2)//3;
	print(ans)
