N = int(input()) if N==0 : print(3) else: x = 4.0 y = 3.0 while N != 1: x = y*19 - x*12 x /= 4.0 x,y = y,x N = N - 1 print(y)