#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) int K; signed main() { cin >> K; double ret = 0; int trynum = 1e7; REP(i,trynum) { int s = 0; int cnt = 0; while(true) { s += 1 + rand() % 6; cnt++; if (s == K) { ret += 1.0 * cnt / trynum; break; } else if (s > K) { s = 0; } } } printf("%.14f\n", ret); return 0; }