#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define INF 1000000000 using namespace std; typedef long long ll; int N; double p; const int MAXN = 1000100; double a[MAXN]; int main(void) { cin >> N >> p; for (int i = 2; i <= N; i++) a[i] = 1; for (int i = 2; i <= N; i++) { for (int j = 2; i*j <= N; j++) { a[i*j] *= 1.0-p; } } double ans = 0; for (int i = 2; i <= N; i++) { ans += a[i]; } printf("%.10lf\n", ans); return 0; }