uses crt;
function Fib(n:integer):integer;{вычисление чисел Фибоначчи}
begin
if n<2 then Fib:=1
else Fib:=Fib(n-1)+Fib(n-2);
end;
var n,i,j,fb:integer;
s,fc:real;
begin
clrscr;
write('n=');
readln(n);
s:=0;
fc:=1;
for i:=1 to n do
begin
fc:=fc*i;{считаем числитель}
fb:=0;
for j:=1 to i do
fb:=fb+(i+Fib(j));{знаменатель}
s:=s+fc/fb;{сумму}
end;
write('S=',s:0:4);
readln
end.