from decimal import Decimal, getcontext getcontext().prec = 100 N = Decimal(input()) if N==0 : print(4) else: x = Decimal(4.0) y = Decimal(3.0) while N != 1: x = y*Decimal(19) - x*Decimal(12) x /= Decimal(4.0) x,y = y,x N = N - 1 print(y)