import std.stdio, std.conv, std.math, std.string, std.range, std.array, std.algorithm; enum double[] ans = mkans(21); double[] mkans(int mx) { double[] ans; ans.length = mx; foreach(immutable int x; 1 .. mx) { 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; } void main(){ auto x = readln().strip().to!int(); writefln("%1.10f", ans[x]); }