def pi(L): X=[0]*(2*N) for i in range(2*N): if i%2: X[(i-1)//2+N]=L[i] else: X[i//2]=L[i] return X N=int(input()) M=list(range(2*N)) L=list(range(2*N)) K=0 while K==0 or L!=M: L=pi(L) K+=1 print(K)