#include #include #include #include #include using namespace std; int k; vector plays; vector pow6; void dfs(int x, int times) { if (x >= k) { plays[times] += pow6[k - times]; return ; } for (int i = 1; i <= 6; i++) { dfs(x + i, times + 1); } } int main() { cin >> k; plays.assign(21, 0); pow6.assign(21, 0); pow6[0] = 1; for (int i = 1; i <= 20; i++) { pow6[i] = pow6[i - 1] * 6; } dfs(0, 0); long long sum = 0; for (int i = 0; i < plays.size(); i++) { sum += plays[i] * i; } double ans = 1.0 * sum / pow6[k]; printf("%.5f\n", ans); return 0; }