#include long count[32]; long K; void solve(int t, int sum) { if( sum >= K ) { count[t] += 1; return; } solve(t+1, sum+1); solve(t+1, sum+2); solve(t+1, sum+3); solve(t+1, sum+4); solve(t+1, sum+5); solve(t+1, sum+6); return; } int main() { std::cin >> K; for(int i = 0; i < 32; ++i) { count[i] = 0; } solve(0, 0); double ans = 0; for(int i = 0; i < 32; ++i) { ans += i * count[i] / pow(6, i); } printf("%.10lf\n", ans); return 0; }