"""from itertools import permutations N=int(input()) T=["","シイタケヤマイキタイ","オオツカコクサイビジツカン","springeightpicnic"] U=["","シイタ+ケヤマ==イキタイ","オオツカ+コクサイ==ビジツカン","spring+eight==picnic"] V=["","シイタ+ケヤマ","オオツカ+コクサイ","spring+eight"] S=list(set(T[N])) X=0 iter=permutations(range(0,10),len(S)) for Y in iter: A=U[N] for k in range(len(S)): A=A.replace(S[k],str(Y[k])) try: if eval(A): X=Y except: pass Z=V[N] for k in range(len(S)): Z=Z.replace(S[k],str(X[k])) print(eval(Z)) """ N=int(input()) if N==1: print(1481) elif N==2: print(10947) else: print(841341)