program Kursovaya;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
p,y,t,n,x,q,r,e,m:real;
begin
writeln('vvedite n');
readln(n);
n:=exp(n*ln(2));
m:=1;
x:=1;
p:=1;
while m<>n do
begin
while x<>m do
begin
y:=1;
t:=1;
while y<>x-1 do
begin
t:=t*y;
y:=y+1;
end;
q:=cos(pi*((t+1)/x))*cos(pi*((t+1)/x));
x:=x+1;
end;
r:=exp(1/n*ln(q));
e:=exp(1/n*ln(n));
p:=p+r*e;
end;
writeln(p:4:3);
readln(p);
{ TODO -oUser -cConsole Main : Insert code here }
end.