#递归~稍微高级点的
def dg(n):
a=1
b=1
t=1
sum = 2
for i in range(3,n+1):
t =a+b
a=b
b=t
sum += pow(t,2)
#print(sum)
print(sum )
a=int(input())
dg(a)
#递归~稍微高级点的
def dg(n):
a=1
b=1
t=1
sum = 2
for i in range(3,n+1):
t =a+b
a=b
b=t
sum += pow(t,2)
#print(sum)
print(sum )
a=int(input())
dg(a)