from __future__ import print_function
from sys import stdin

def printf(str, *args):
	print(str % args, end='')

def G_func(n):
	G=1
	if n>=0:
		if n==0:
			G *=1
		elif n==1:
			G *=2
		else:
			G=G_func(n-2) * G_func(n-2) * G_func(n-1)
	return G

printf("input number :")
i = int(stdin.readline())
printf("%d번재 항의 값 G(%d) = %d\n" %((i+1),i,G_func(i)) )

stdin.readline()