import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict con = 10 ** 9 + 9; INF = float("inf") def getlist(): return list(map(int, input().split())) def mul(A, B): C = [[0] * len(B[0]) for i in range(len(A))] for i in range(len(A)): for k in range(len(B)): for j in range(len(B[0])): C[i][j] = (C[i][j] + A[i][k] * B[k][j]) return C def matrixPow(A, n, N): B = [[0] * N for i in range(N)] for i in range(N): B[i][i] = 1 while n > 0: if n & 1 == 1: B = mul(A, B) A = mul(A, A) n = n >> 1 return B #処理内容 def main(): N = int(input()) A = [[19 / 4, -3], [1, 0]] B = matrixPow(A, N, 2) # print(B) anspre = mul(B, [[3], [4]]) ans = anspre[1][0] print(ans) if __name__ == '__main__': main()