import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner scan = new Scanner(System.in); int K = scan.nextInt(); double sum = 0; double ans = calc(K , 0 , sum); System.out.println(String.format("%.10f" , ans)); } private static double calc(int K , int num , double sum){ if(num >= K){ return 0; } sum = sum + calc(K , num+1 , sum) / 6 + calc(K , num+2 , sum) / 6 + calc(K , num+3 , sum) / 6 + calc(K , num+4 , sum) / 6 + calc(K , num+5 , sum) / 6 + calc(K , num+6 , sum) / 6 + 1; return sum; } }