#include using namespace std; double dp[1000][1<<6]; int n; double rec(int k, int S) { double &res = dp[k][S]; if (res != -1) { return res; } if (k == 0) { res = (S == 0) ? 1 : 0; } else if (S == 0) { res = 1; } else { res = 0; for (int i = 0; i < 6; ++i) { res += 1./6 * rec(k - 1, S & ~(1 << i)); } } // cout << bitset<6>(S) << ' ' << k << ' ' << res << endl; return res; } int main() { while (cin >> n) { double ans; if (n > 500) { ans = 1; } else { fill((double*)begin(dp), (double*)end(dp), -1); ans = rec(n, 63); } printf("%.10lf\n", ans); } }