#include using namespace std; int main(){ int N; cin >> N; double p; cin >> p; double ans=0; for(int i=2;i<=N;i++){ vector divisor; for(int j=1;j*j<=i;j++){ if(i%j==0){ divisor.push_back(j); if(j!=i/j) divisor.push_back(i/j); } } ans+=pow(1-p,divisor.size()-2); } cout << setprecision(10) << ans << endl; }