#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair pii; typedef vector vll; typedef vector vi; typedef vector> vvi; typedef vector> vvll; const ll inf = 1e16; const ll md = 1000000007; int main() { int n; double p; cin>>n>>p; vector sp(n+1,1.); double ans=0; for(int a=2;a<=n;a++){ ans+=sp[a]; for(int b=a*2;b<=n;b+=a) sp[b]*=1-p; } printf("%.7f"); return 0; }