#include #include #include using ldouble = long double; void solve() { int k; std::cin >> k; std::vector dp(k + 1, 1); dp[k] = 0; for (int d = k - 1; d >= 0; --d) { for (int f = 1; f <= 6; ++f) { dp[d] += dp[std::min(k, d + f)] / 6; } } std::cout << std::fixed << std::setprecision(10) << dp[0] << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }