program hanoi(input,output);
var
a:array[0..200]of integer;
n,i,j:integer;
begin
assign(input,'hanoi.in');
assign(output,'hanoi.out');
reset(input);rewrite(output);
read(n);
a[0]:=1;
a[1]:=2;
for i:=1 to n do begin
for j:=a[0]downto 1 do begin
a[j]:=a[j]*2;
if a[j]>=10 then begin a[j+1]:=a[j+1]+1;a[j]:=a[j]mod 10;end;
end;
if a[a[0]+1]<>0 then a[0]:=a[0]+1;
end;
a[1]:=a[1]-2;
for i:=a[0]downto 1 do write(a[i]);
close(input);close(output);
end.