program bly(input,ouput);
type
t1=array[0..60] of integer;
var
g:t1;
f1,f2:text;
i,j:integer;
long,n:integer;
procedure cheng(a:t1);
var
i0:integer;
begin
for i0:=60 downto 1 do begin
g[i0]:=g[i0]*2;
end;
for i0:=60 downto 1 do begin
g[i0-1]:=g[i0-1]+g[i0] div 10;
g[i0]:=g[i0] mod 10;
end;
end;
begin
assign(f1,'hanoi.in');
reset(f1);
readln(f1,n);
close(f1);
long:=59;
g[60]:=2;
for i:=1 to n do cheng(g);
if g[60]>=2 then g[60]:=g[60]-2
else begin dec(g[59]); g[60]:=g[60]+8; end;
assign(f2,'hanoi.out');
rewrite(f2);
for i:=1 to 60 do begin
if g[i]<>0 then write(f2,g[i]);
end;
close(f2);
end.