#include using namespace std; const int MAXN = int(1e6); int N; double dp[MAXN + 1][6 + 1]; int main() { ios::sync_with_stdio(false); cin >> N; dp[1][1] = 1.0; for (int i = 1; i < N; ++i) { for (int j = 1; j <= 6; ++j) { if (j == 6) dp[i + 1][j] += dp[i][j]; else { dp[i + 1][j] += dp[i][j] * j / 6; dp[i + 1][j + 1] += dp[i][j] * (6 - j) / 6; } } } cout << fixed << setprecision(9) << dp[N][6] << endl; return 0; }