#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(void) { ll N; cin >> N; if (N >= 140) { cout << "0.9999999999" << endl; return 0; } double dp[N+1][7]; dp[1][0] = 0; dp[1][1] = 1; for (int i=2; i<=6; i++) dp[1][i] = 0; for (int i=2; i<=N; i++) for (int j=1; j<=6; j++) { dp[i][j] = ( (dp[i-1][j] * j) + (dp[i-1][j-1] * (7-j)) ) / 6; } printf("%.10f\n",dp[N][6]); return 0; }