#include using namespace std; template void cmin(T &a, U b) { if (a > b) a = b; } template void cmax(T &a, U b) { if (a < b) a = b; } signed main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); random_device rd; mt19937 mt(rd()); long K; cin >> K; long ans = 0; for (long i = 1e6; i; i--) { long sum = 0, cnt = 0; while (true) { sum += mt() % 6 + 1, cnt++; if (sum == K) { ans += cnt; break; } else { if (sum > K) sum = 0; } } } cout << fixed << setprecision(3) << ans / 1e6 << "\n"; }