#include<stdio.h>
#include<algorithm>
using namespace std;
double dp[1020][520];
int n;
double solve(int a,int b){
	if(dp[a][b]>-0.5)return dp[a][b];
	if(a==0)return 0;
	double ret=0;
	if(b>0&&a-b>0)ret+=solve(a-2,b-1)*b/(a-b);
	
	if(a-2*b>0&&a-b>0&&b>0&&a-b-1>0)ret+=(solve(a-2,b)+1)*(a-2*b)/(a-b)*(b)/(a-b-1);
	if(a-2*b>0&&a-b>0&&a-b-1>0&&a-2*b-1>0)ret+=solve(a,b+2)*(a-2*b)/(a-b)*(a-2*b-2)/(a-b-1);
	if(a-2*b>0&&a-b>0&&a-b-1>0)ret+=solve(a-2,b)*(a-2*b)/(a-b)/(a-b-1);
	//printf("%d %d: %f\n",a,b,ret);
	return dp[a][b]=ret+1;
}
int main(){
	int a;
	while(scanf("%d",&a),a){
		a/=2;
		n=a;
		for(int i=0;i<=a*2;i++)for(int j=0;j<=a;j++)
			dp[i][j]=-1;
		printf("%.12f\n",solve(a*2,0)-a);
	}
}