#include #include #include using namespace std; int main() { int n; cin >> n; vector dp(7); dp[0] = 1; for (int i = 0; i < n; i++) { for (int j = 5; j >= 0; j--) { dp[j + 1] += dp[j] * (6 - j) / 6.0; dp[j] = dp[j] * j / 6.0; } } printf("%.20f\n", dp[6]); }