#include<iostream>
#include<cmath>

using namespace std;

double Calculate(double);

int main(){
  double n;
  while(1){
    cin >> n;
    if(n == 0) break;
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(6);
    cout << Calculate(n) << endl;
  }
  return 0;
}

double Calculate(double n){
  double t1, t2, a, b;
  if((int)n%3 != 0) n *= 3.0;
  t1 = M_PI*(5.0/6.0 - 1.0/n);
  t2 = M_PI/n;
  a = 1.0/sqrt((3.0*(1.0 + 4.0*sin(t2)*sin(t2) - 4.0*sin(t2)*cos(t1))));
  b = 2.0*a*sin(t2);
  return n*a*b*sin(t1);
}