#include using namespace std; #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif #define int long long signed main(){ double n, p; cin >> n >> p; vector dp(n + 1, 1); for(int i = 2; i <= n; i++){ for(int j = i+i; j <= n; j+=i){ dp[j] *= (1.0 - p); } } double ans = 0; for(int i = 2; i <= n; i++){ ans += dp[i]; } printf("%.7f\n", ans); return 0; }