#include #include #include #include //#include #include #include #include #include #include //#include #include #include #include //#include #include #include //#include #include #include #include #include const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; using namespace std; typedef long long ll; typedef vector vi; typedef vector vll; typedef pair pii; int main() { cin.tie(0); ios::sync_with_stdio(false); int K; cin >> K; vector dp(K+1, 0); for (int t = 0; t < 10000; t++) { for (int i = 1; i <= K; i++) { double tmp = 6; for (int j = 1; j <= 6; j++) { if (i-j < 0) tmp += dp[K]; else tmp += dp[i-j]; } dp[i] = tmp/6; } } printf("%.10lf\n", dp[K]); return 0; }