#include using namespace std; int main() { int N; double p; cin >> N >> p; auto div = [](int n) { int ret; for (int i = 1; i * i <= n; i++) { if (n % i == 0) { ret++; if (i * i != n) ret++; } } return ret; }; double ans = 0; for (int i = 2; i <= N; i++) { ans += pow(1 - p, div(i) - 2); } cout << fixed << setprecision(10) << ans << endl; }