#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 n; int d[1000100]; int main() { cin >> n; long double p; cin >> p; long double ans = 0.0; memset(d, 0, sizeof(d)); for(int i = 2; i <= n; ++i) { for(int m = i; m <= n; m+=i) { d[m]++; } ans += powl((1LL-p), d[i]-1); } cout << setprecision(14) << ans << endl; }