





def lowerCAmelCase__(__snake_case = 4000000							)    ->				int:







	'''simple docstring'''







	if n <= 1:
		return 0
	lowerCamelCase__        =		0
	lowerCamelCase__        =		2
	lowerCamelCase__        =		0
	while 4 * b + a <= n:
		lowerCamelCase__    ,     lowerCamelCase__        =		b, 4 * b + a
		count += a
	return count + b


if __name__ == "__main__":
			print(f"""{solution() = }""")










import os





def lowerCAmelCase__()    ->				int:







	'''simple docstring'''







	lowerCamelCase__        =		os.path.dirname(os.path.realpath(__snake_case							)							)
	lowerCamelCase__        =		os.path.join(__snake_case	,'''triangle.txt'''							)

	with open(__snake_case							) as in_file:
		lowerCamelCase__        =		[[int(__snake_case							) for i in line.split()] for line in in_file]

	while len(__snake_case							) != 1:
		lowerCamelCase__        =		triangle.pop()
		lowerCamelCase__        =		triangle[-1]
		for j in range(len(__snake_case							) - 1							):
			curr_row[j] += max(last_row[j]	,last_row[j + 1]							)
	return triangle[0][0]


if __name__ == "__main__":
			print(solution())



