#include #include using namespace std; int n; double x(int nw){ if(nw == n){ return 1; } double ret = 0; for(int i = 1; 6 >= i; i++){ if(nw+i > n)break; ret += x(nw+i)*((double)1/6); } return ret+1; } int main(){ cin>>n; cout << fixed << setprecision(10) << x(1) << endl; }