#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair pii; template bool chmax(T &a, const T &b) { if (a bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } map memo; double rec(int x){ if(x <= 0) return memo[x] = 0; if(memo.count(x) > 0) return memo[x]; double ret = 1.0; rep(i, 6) ret += rec(x - (i + 1)) / 6.0; return memo[x] = ret; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int k; cin >> k; cout << fixed << setprecision(10); cout << rec(k) << endl; }