#include <bits/stdc++.h>
#ifdef _DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif
#define REP(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
template<class T, class U> inline bool chmax(T &a, const U &b) { if(a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if(a > b) { a = b; return true; } return false; }

ld p;

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  cin >> p;
  ld E = 0, P = 1;
  for(ld i = 0; i <= 100000; i++) {
    E = E+P*(1-p)*i;
    P = P*p;
  }
  cout << fixed << setprecision(13) << E << '\n';
  return 0;
}