uses crt;
var n,i:integer;
s1,s2:real;
{-------------------chuong-trinh-con-nhap--------------------------}
procedure nhap(var x:integer);
begin
repeat
write('nhap mot so tu nhien bat ky:'); readln(x);
if (x<=0) or (x>=13) then writeln('ban da nhap sai, yeu cau ban nhap lai');
until (x>0) and (x<13);
end;
{-------------------chuong-trinh-con-tinh-tong-s1--------------------------}
function tong1(var a:integer):real;
var t1:real;
begin
t1:=0;
for i:=1 to a do
t1:=t1+i/(i+1);
tong1:=t1;
end;
{------------------chuong-trinh-con-tinh-tong-s2----------------------}
function tong2(var z:integer):real;
var t2:real;
j:integer;
gt:real;
begin
t2:=0;
for i:=1 to z do
begin
gt:=1;
for j:=1 to i do
gt:=gt*j;
t2:=t2+1/gt;
end;
tong2:=t2;
end;
{--------------------chuong-trinh-chinh-------------------------------}
begin
clrscr;
nhap(n);
s1:=tong1(n);
s2:=tong2(n);
writeln('tong s1=',s1:7:3);
writeln('tong s2=',s2:7:3);
readln;
end.