#include using namespace std; const int MAX_N = 1000000; double dp[MAX_N + 1]; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; double p; cin >> n >> p; p = 1 - p; fill(dp + 2, dp + n + 1, 1.0); for (int i = 2; i <= n / 2; i++) { for (int j = 2; i * j <= n; j++) { dp[i * j] *= p; } } double ans = 0.0; for (int i = 2; i <= n; i++) ans += dp[i]; printf("%.10lf\n", ans); return 0; }