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






def solve(m):
	n=m+1
	middle=2000
	if n<=2000:
		return calc(n)
	else:
		return calc(4002-n)




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