Optimize a Python program that calculates the sum of the numbers up to a given integer.
integer = 5

def calculateSum(n):
	sum = 0
	for i in range(n+1):
		sum = sum + i
	
	return sum

print(calculateSum(integer))
def calculateSum(n):
	return (n * (n+1))//2

print(calculateSum(integer))