#include using namespace std; const int MAX = 1e6 + 10; long double dp[8], dp2[8]; long double *now, *nxt; int main() { int n; cin >> n; now = dp; nxt = dp2; now[0] = 1; for (int i = 0; i < n; i++) { for (int j = 0; j <= 6; j++) { nxt[j] = 0; } for (int j = 0; j <= 6; j++) { long double hoge = now[j] / 6; nxt[j + 1] += hoge * (6 - j); nxt[j] += hoge * j; } swap(now, nxt); } cout << fixed << setprecision(10) << now[6] << endl; return 0; }