#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int K; cin >> K; vector E(K + 1, 1); for(int x = K; x >= 1; x--) { for(int y = 1; y <= 6; y++) if(x + y <= K) E[x] += E[x + y] / 6.0; } cout << fixed << setprecision(20) << E[1] << endl; }