#include "bits/stdc++.h" using namespace std; int main() { int N; double P; cin >> N >> P; P = 1 - P; vector Count(N + 1, 0); vector Pow(N + 1); Pow[0] = 1; for (int i = 0; i < N; i++) Pow[i + 1] = Pow[i] * P; for (int i = 2; i <= N; i++) { for (int j = 2; i * j <= N; j++) { Count[i * j]++; } } double ANS = 0; for (int i = 2; i <= N; i++) { ANS += Pow[Count[i]]; } printf("%.12lf\n", ANS); }