import std.stdio, std.conv, std.math, std.string, std.range, std.array, std.algorithm; double solve(int mx) { if(mx <= 6) return 1.0/6; auto ans = new double[](mx); ans.length = mx+2; foreach(immutable int x; 1 .. mx+2) { if (x == 1) ans[x] = 1; else { double res = 0; foreach(immutable int i; 1 .. 7) { res += 1.0/6 * ((x-i>0)?ans[x-i]:0); } ans[x] = res + 1; } } return ans[mx+1] - ans[mx]; } void main(){ auto K = readln().strip().to!int(); double a = solve(K); double ans = 0; double a_i=1; foreach(immutable int i; 1 .. 10000) { ans += i * a * a_i; a_i *= 1-a; } writefln("%1.10f", ans+6); }