/*
AizuOnline A2097

*/
#include <stdio.h>
#include <float.h>
#include <math.h>

#define PAI 3.1415926535

main()
{
  int n;
  double S,r,r1;
  while(EOF != scanf("%d",&n) && n)
    {
      if(n % 3)
	n *= 3;
      if(n==3)
	S = sqrt(3.0)/4;
      else
	{
	  r = sqrt(3.0)/3;
	  r1= r*sin(PAI/6)/sin(PAI-PAI/6-PAI/n);
	  S = n*sin(PAI/n)*r*r1;
	}
      printf("%lf\n",S);
    }

return(0);
}