def calc(n):
	#n+n*(n+4)*(n-1)/6
	n=n+1
	return int(n+n*(n+4)*(n-1)/6)






def solve(n):
	#the range of n is 0-4000
	#the center is 2000.5 
	if n<=2000:
		return calc(n)
	else:
		return calc(4000-n)
	



	
while True:
	try:
		n=int(input())
		print(solve(n))
	except EOFError:
		break