main(n){
	scanf("%d",&n);
	printf("%.9f",
		1
		- 6*pow(5/6.,n)
		+15*pow(4/6.,n)
		-20*pow(3/6.,n)
		+15*pow(2/6.,n)
		- 6*pow(1/6.,n)
	);
}