import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int k=sc.nextInt(); Random r=new Random(); int ans=0; int i=0; while(i<2000000){ int sum=0; int t=0; while(true){ int n=r.nextInt(6)+1; t++; sum+=n; if(sum>k)sum=0; else if(sum==k)break; } ans+=t; i++; } System.out.println((double)ans/2000000); } }