#include using namespace std; typedef pair P; typedef pair> PP; typedef long long ll; const double EPS = 1e-8; const int INF = 1e9; const int MOD = 1e9+7; int dy[] = {0,1,0,-1}; int dx[] = {1,0,-1,0}; int main(void) { int n;double p; cin >> n >> p; vector prob(n+1,1.); double ret = 0; for(int i=2;i<=n;i++){ ret += prob[i]; for(int j=2;i*j<=n;j++){ prob[i*j] *= 1.-p; } } cout << fixed << setprecision(10) << ret << endl; return 0; }