#include "bits/stdc++.h" using namespace std; #define MAX 500 double dp[MAX]; int main(){ int K; cin >> K; dp[0] = 0; for (int t = 0; t < 10000; t++) { for (int i = 1; i <= K; i++) { double temp = 6; for (int j = 1; j <= 6; j++) { if (i - j < 0) temp += dp[K]; else temp += dp[i - j]; } dp[i] = temp / 6; } } printf("%.14f\n", dp[K]); }