#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; int main() { int N; cin >> N; double dp[N + 1][7]; memset(dp, 0, sizeof(dp)); dp[0][0] = 1.0; for (int i = 0; i < N; ++i) { for (int j = 0; j <= 6; j++) { dp[i + 1][j + 1] += (6.0 - j) / 6.0 * dp[i][j]; dp[i + 1][j] += (j / 6.0) * dp[i][j]; } } cout << fixed << setprecision(10) << dp[N][6] << endl; return 0; }