def a(k, memo={0 : 4, 1 : 3}): if k in memo: return memo[k] memo[k] = (19 * a(k - 1, memo) - 12 * a(k - 2, memo)) / 4 return memo[k] if __name__ == '__main__': k = int(input()) print("{0:f}".format(a(k)))