#include #include #include #include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); uint32_t N, i, j; double p; cin >> N >> p; vector dp(N + 1, 1); double ans = 0; dp[0] = dp[1] = 1; for (i = 2; i <= N; ++i) { ans += dp[i]; for (j = i * 2; j <= N; j += i) dp[j] *= 1 - p; } cout << fixed << setprecision(10) << ans << '\n'; return 0; }