const
  eps = 0.0000001;
var
  last,cur,x : real;
  n,ng       : longint;
begin
  last:=0;
  cur:=25;
  n:=0;ng:=0;
  randomize;
  while (abs(cur-last) > eps) or (n<10000) do
   begin
     inc(n);
     if random*5 < sqrt(25-sqr(random*5)) then inc(ng);
     last:=cur;
     cur:=ng/n;
   end;
  WriteLn('Pi: ',cur*4:0:10);
end.