#include #define show(x) cerr << #x << " = " << x << endl using namespace std; using ll = long long; using pii = pair; using vi = vector; template ostream& operator<<(ostream& os, const vector& v) { os << "sz=" << v.size() << "\n["; for (const auto& p : v) { os << p << ","; } os << "]\n"; return os; } template ostream& operator<<(ostream& os, const pair& p) { os << "(" << p.first << "," << p.second << ")"; return os; } constexpr ll MOD = 1e9 + 7; template constexpr T INF = numeric_limits::max() / 100; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; if (N > 200) { cout << 1 << endl; return 0; } vector> dp(N, vector(6, 0)); dp[0][0] = 1; for (ll i = 0; i < N - 1; i++) { dp[i + 1][5] = dp[i][5]; for (ll j = 0; j < 5; j++) { dp[i + 1][j] += dp[i][j] * (long double)(j + 1) / 6; dp[i + 1][j + 1] += dp[i][j] * (long double)(5 - j) / 6; } } cout << fixed << setprecision(10) << dp[N - 1][5] << endl; return 0; }