import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys from collections import deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap,0,len(heap)-1) from math import gcd as Gcd read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines N=int(readline()) if N==0: ans=4 else: ans=pow(3,N)/pow(4,N-1) print(ans)