#include "bits/stdc++.h" using namespace std; void solve() { int n; double p; cin >> n >> p; vector dp(n+1, 1); double ans = 0; for (int i = 2; i <= n; i++) { for (int j = 2*i; j <= n; j += i) { dp[j] *= 1 - p; } ans += dp[i]; //cout << i << ' ' << dp[i] << endl; } cout << fixed << setprecision(9) << ans << endl; } int main(void) { solve(); //cout << "yui(*-v・)yui" << endl; return 0; }