program ex(f1,f2);
type
zn=array [1..1000] of integer;
var
a:zn; i,j,k,m,n,t:longint; f1,f2:text;
flag:boolean;
begin
assign(f1,'hanoi.in'); reset(f1);
assign(f2,'hanoi.out'); rewrite(f2);
readln(f1,n);
flag:=true;
if n=1 then begin writeln(f2,2); flag:=false; end;
if n=2 then begin writeln(f2,6); flag:=false; end;
if n=3 then begin writeln(f2,14); flag:=false; end;
if flag then
begin
t:=1; a[1]:=8;
for i:=4 to n do
begin
for j:=1 to t do a[j]:=a[j]*2;
for j:=1 to t do
if a[j]>=10 then
begin
a[j+1]:=a[j+1]+(a[j] div 10);
a[j]:=a[j] mod 10;
end;
if a[t+1]>0 then inc(t);
end;
dec(a[1]);
for j:=1 to t do a[j]:=a[j]*2;
for j:=1 to t do
if a[j]>=10 then
begin
a[j+1]:=a[j+1]+(a[j] div 10);
a[j]:=a[j] mod 10;
end;
if a[t+1]>0 then inc(t);
for i:=1 to t do
write(f2,a[t-i+1]);
writeln(f2);
end;
close(f1);
close(f2);
end.