def cal_sum(n):
	 
	a = 3
	b = 0
	c = 2
	if (n == 0): 
		return 3
	if (n == 1): 
		return 3
	if (n == 2): 
		return 5
	sum = 5
	while (n > 2): 
		d = a + b 
		sum = sum + d 
		a = b 
		b = c 
		c = d 
		n = n-1
	return sum
def count_ways(n):
	 
	A = [0] * (n + 1) 
	B = [0] * (n + 1) 
	A[0] = 1
	A[1] = 0
	B[0] = 0
	B[1] = 1
	for i in range(2, n+1): 
		A[i] = A[i - 2] + 2 * B[i - 1] 
		B[i] = A[i - 1] + B[i - 2] 
	return A[n] 