program hanoi(input,output);
var
a:array [1..1000] of longint;
n,j,i,k,fu:longint;
temp,ans:longint;
begin
assign(input,'hanoi.in');
assign(output,'hanoi.out');
reset(input);
rewrite(output);
readln(n);
fillchar(a,sizeof(a),0);
j:=1;
a[1]:=1;
for i:=1 to n+1 do begin
for fu:=j downto 1 do begin
ans:=a[fu]*2;
if ans>=10 then
begin
a[fu]:=ans div 10;
temp:=ans mod 10;
a[fu]:=temp;
a[fu+1]:=a[fu+1]+1;
end
else
a[fu]:=a[fu]*2;
end;
if a[j+1]<>0 then j:=j+1;
end;
a[1]:=a[1]-2;
for i:=j downto 1 do write(a[i]);
close(input);
close(output);
end.