#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair P; const ll INF = 1ll<<60; const ll MOD = 1000000007; const double EPS = 1e-5; int K; double dp[2][201]; int main() { cin >> K; dp[0][0] = 1.0; REP(t, 10000) { int now = t % 2; int next = !now; memset(dp[next], 0, sizeof(dp[next])); REP(i, K + 1) FOR(j, 1, 7) { if (i + j > K) dp[next][0] += dp[now][i] / 6; else dp[next][i + j] += dp[now][i] / 6; } } printf("%.15f\n", 1 / dp[1][K] - 1); return 0; }