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