Problem:


Score : 100 points

Problem Statement

We have a cord whose length is a positive integer. We will perform the following condition until the length of the cord becomes at most 2:

Operation:
  Cut the rope at two positions to obtain three cords, each with a length of a positive integer.
  Among these, discard one with the longest length and one with the shortest length, and keep the remaining one.

Let f(N) be the maximum possible number of times to perform this operation, starting with a cord with the length N.

You are given a positive integer X. Find the maximum integer N such that f(N)=X.

Constraints

1 \leq X \leq 40

Input

The input is given from Standard Input in the following format:

X

Output

Print the value of the maximum integer N such that f(N)=X.

Sample Input 1

2

Sample Output 1

14



Sample input:
2


Sample output:
14

Submission status: Wrong Answer

Solution code:
n=input()
for i in range(n):
    n*=2
    n+=2
print(n)

Submission status: Wrong Answer

Solution code:
print((4<<int(input())+2)-2)

Submission status: Wrong Answer

Solution code:
x = int(raw_input())

cur = 2
for i in range(x):
	cur = cur * 3 - 1
print cur

Submission status: Time Limit Exceeded

Solution code:
a=[-1]*10000000

def f(n):
    if a[n]!=-1:
        return a[n]
    if n<=2:
        a[n]=0
        return a[n]
    for i in range(1,n//3+1):
        for j in range(n//3,n):
            k=n-i-j
            if not(i<=k and k<=j):
                continue
            a[n]=max(a[n],f(k)+1)
    return a[n]
            
x=int(input())
i=3
while f(i)!=x:
    i+=1
while f(i)==x:
    i+=1
print(i-1)

Submission status: Accepted

Solution code:
x=int(input())
a=[6]
for i in range(41):
    a.append(a[-1]*2+2)
print(a[x-1])

Submission status: Accepted

Solution code:
x = int(input())

ans = 2

for i in range(x):
 ans = ans * 2 + 2

print(ans)

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    dp = [0] * (X+1)
    dp[0] = 2
    for i in range(X):
        dp[i+1] = dp[i] * 2 + 2
    print(dp[X])


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
print((4<<int(input()))-2)

Submission status: Accepted

Solution code:
x = int(input())
now = 3
for _ in range(x):
  now = now*2+1
print(now-1)

Submission status: Accepted

Solution code:
x=int(input())
l,r=0,100000000000000
while r-l>1:
  m=(l+r)//2
  t=m
  cnt=0
  while m>2:
    cnt+=1
    m=(m-1)//2
  if cnt>x:
    r=t
  else:
    l=t
print(l)

Submission status: Accepted

Solution code:
x = int(input())
def f(x):
  if x == 1:
    return 7
  else:
    return f(x-1) * 2 + 1
  
ans = f(x) - 1

print(ans)

Submission status: Accepted

Solution code:
x = int(input())
ans = 2
for i in range(x):
    ans = ans * 2 + 2
print(ans)

Submission status: Accepted

Solution code:
def g(n):
  if n==1:
    return 3
  else:
    return g(n-1)*2 + 1
X = int(input())
print(g(X+1)-1)

Submission status: Accepted

Solution code:
x = int(input())
n = 6
for i in range(x-1):
    n = 2*n+2
print(n)

Submission status: Accepted

Solution code:
print(2**(int(input())+2)-2)

Submission status: Accepted

Solution code:
print(2**(2+int(input()))-2)

Submission status: Accepted

Solution code:
g = [None]*50
h = [None]*50
h[1] = 3
g[1] = 6
X= int(input())
for i in range(2, X+1):
    h[i] = g[i-1] + 1
    g[i] = 2*h[i]
print(g[X])

Submission status: Accepted

Solution code:
n = int(input())


co = 2
if n == 0:
	print(2)
else:
	for i in range(n):
		co = 2 * co + 2
	print(co)

Submission status: Accepted

Solution code:
X = int(input())

ans = 1
for _ in range(X+1):
    ans = 2*ans + 1
print(ans - 1)

Submission status: Accepted

Solution code:
print 4*2**input()-2

Submission status: Accepted

Solution code:
def f(n):
    if a[n]!=0:
        return a[n]
    if n==0:
        a[n]=2
    else:
        a[n]=f(n-1)*2+2
    return a[n]
            
x=int(input())
a=[0]*(x+1)
print(f(x))

Submission status: Accepted

Solution code:
n=int(input()) 
f=[2] 
for x in range(1,n+1): 
    f.append(f[x-1]*2+2)
print (f[n])

Submission status: Accepted

Solution code:
n=int(input())
f=[2]
for x in range(1,n+1):
    f.append(f[x-1]*2+2)
print (f[n])

Submission status: Accepted

Solution code:
n=int(input())
f=[2]
for x in range(1,501):
    f.append(0)
for x in range(1,n+1):
    f[x]=f[x-1]*2+2
print (f[n])

Submission status: Accepted

Solution code:
x = int(input())
ans = 1
for i in range(x): ans = 2*ans+1
print(2*ans)

Submission status: Accepted

Solution code:
n = int(raw_input())
f = [0] * (n + 1)
f[0] = 2
for i in range(n + 1):
    f[i] = f[i - 1] * 2 + 2
print f[n]

Submission status: Accepted

Solution code:
N = int(input())
k = 2
for i in range(N):
    k = 2*(k+1)
print(k)

Submission status: Accepted

Solution code:
def f(n): return 1 if n==0 else 2*f(n-1)+1
x = int(input())
print(f(x+1)-1)

Submission status: Accepted

Solution code:
x=int(input())
n=2
for i in range(x):
    n=n+n+1+1
print(n)

Submission status: Accepted

Solution code:
x=int(raw_input())
ans=2
for i in xrange(x):
    ans=ans+ans+2
print ans

Submission status: Accepted

Solution code:
x=int(raw_input())
x-=1
ans=6
for i in xrange(x):
    ans=ans+ans+2
print ans

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def g(x):
    if x == 0:
        return 1
    else:
        return 1 + g(x-1) * 2
x = int(input())
print(g(x+1)-1)

Submission status: Accepted

Solution code:
x=int(input())
ans=0
for i in range(1,x+2):
    ans+=2**i
print(ans)

Submission status: Accepted

Solution code:
x=int(input())
j=2
for i in range(x):
	j*=2
	j+=2
print(j)

Submission status: Accepted

Solution code:
X = int(raw_input())
length = 2
for i in range(X):
    length = 2 * length + 2

print length

Submission status: Accepted

Solution code:
x = input()
N = 1
ans = 7
while x > N:
    ans = 1 + ans*2
    x -= 1
print ans-1

Submission status: Accepted

Solution code:
x = int(raw_input())

cur = 2
for i in range(x):
	cur = (cur + 1) * 2
print cur

Submission status: Runtime Error

Solution code:
print(4<<int(input())-2)