program mason;
var ms:array[1..100]of integer;
i,j,p,max:longint;
f1:text;
begin
assign(f1,'hanoi.in');
reset(f1);
readln(f1,p);
close(f1);
ms[1]:=2;
max:=1;
for i:=2 to p+1 do
begin
for j:=1 to max do
ms[j]:=ms[j]*2;
for j:=1 to max do
begin
if ms[j]>=10 then
begin
ms[j+1]:=ms[j+1]+1;
ms[j]:=ms[j]-10;
end;
end;
if ms[max+1]<>0 then inc(max);
end;
ms[max]:=ms[max]-2;
assign(f1,'hanoi.out');
rewrite(f1);
for i:=max downto 1 do
write(f1,ms[i]);
close(f1);
end.