import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); double [] E = new double [K+5]; E[K]=E[K+1]=E[K+2]=E[K+3]=E[K+4]=0; E[K-1]=1; for(int i=K-2; i>=0; i--){ E[i]=1+(E[i+1]+E[i+2]+E[i+3]+E[i+4]+E[i+5]+E[i+6])/6.0; } System.out.println(E[0]); } }