#include #include #include unsigned int xor128() { 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)); } std::map m; int main() { int K; scanf( "%d", &K ); clock_t t = clock(); int total = 0; while( clock() <= t+4*CLOCKS_PER_SEC ) { int sum = 0, cnt = 0; for(;;) { int n = xor128()%6+1; sum += n; ++cnt; if( sum == K ) break; if( sum > K ) sum = 0; } ++m[cnt]; ++total; } double ans = 0; for( auto it = m.begin(); it != m.end(); ++it ) ans += (double)it->first*it->second/total; printf( "%.2f\n", ans ); return 0; }