Program cog853;
Var
A:Array[1..8]Of Longint;
I,J,S,N:Longint;
Begin
Assign(Input,'spread.in');
Assign(Output,'spread.out');
Reset(Input);
Rewrite(Output);
Fillchar(A,Sizeof(A),0);
A[1]:=1;
Readln(N);
For I:=1 To N Do
Begin
S:=0;
Inc(A[8],A[7]);
For J:=7 Downto 2 Do A[J]:=A[J-1];
For J:=3 To 7 Do Inc(S,A[J]);
A[1]:=S Shl 1;
End;
S:=0;
For I:=1 To 8 Do Inc(S,A[I]);
Writeln(S);
Close(Input);
Close(Output);
End.