#include using namespace std; typedef long long ll; #define REP(i, n) for(int(i)=0;(i)<(n);++(i)) #define REPEAT(i, k, n) for(int(i)=(k);(i)<((k)+(n));++(i)) #define EPS 1e-4 unsigned int xor128(void) { static unsigned int x=123456789,y=362436069,z=521288629,w=88675123; unsigned int t=(x^(x<<11));x=y;y=z;z=w; return( w=(w^(w>>19))^(t^(t>>8)) ); } int main(){ int K; cin >> K; map m; clock_t t = clock() + CLOCKS_PER_SEC * 4; int total = 0; while(t >= clock()){ int c = 0, sum = 0; while(1){ sum += xor128()%6+1; c++; if(sum == K) break; if(sum > K) sum = 0; } m[c]++; total++; } double res = 0; for(auto it = m.begin(); it != m.end(); ++it){ res += it->first * ((double)it->second / total); } printf("%.12f\n", res); return 0; }