#include #define rep(i, n) for(long long i = 0; i < (long long)n; i++) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; using ld = long double; int main() { int k; cin >> k; vector v(30, -1); auto f = [&](auto f, int x) -> ld { if (x >= k) { return 0.0; } if (v[x] != -1) { return v[x]; } ld res = 0.0; for (int i = 1; i <= 6; i++) { res += f(f, x + i); } res /= 6.0; res += 1.0; v[x] = res; return res; }; cout << fixed << setprecision(20) << f(f, 0) << endl; }