#include #include using namespace atcoder; using namespace std; using ll=long long; using ld=long double; ld pie=3.14159265359; ll mod=998244353; ll inf=99999999999999999; int main(){ ll n; cin >> n; ld p; cin >> p; vectormemo(n+1,1); for (ll i = 2; i <=n; i++) { for (ll j = 2; j >=0; j++) { if (i*j>n) { break; } memo[i*j]*=(1.0-p); } } ld ans=0; for (ll i = 2; i <=n; i++) { ans+=memo[i]; } cout << setprecision(20) << ans << endl; }