#include using namespace std; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } using ll = long long; using P = pair; const long double PI = acos(-1.0L); ll GCD(ll a, ll b) { return b?GCD(b, a%b):a; } ll LCM(ll a, ll b) { return a/GCD(a, b)*b; } int main() { int n; cin >> n; long double ans = 0.0L; ans = 6.0L*powl(5.0L/6.0L, n) - 15.0L*powl(4.0L/6.0L, n) + 20.0L*powl(3.0L/6.0L, n) - 15.0L*powl(2.0L/6.0L, n) + 6.0L*powl(1.0L/6.0L, n); cout << setprecision(14) << 1.0L-ans << endl; }