#include using namespace std; double dp[1000001]; int main() { int n; cin >> n; double p; cin >> p; dp[0] = 1; for (int i = 1;i <= 1000000;i++) { dp[i] = (1 - p)*dp[i - 1]; } double ans = 0; for (int i = 2;i <= n;i++) { int num = 1; int x = i; multiset set; for (int j = 2;j*j <= x;j++) { while (x%j == 0&&j*j<=x) { x /= j; set.insert(j); } } set.insert(x); while (!set.empty()) { num *= set.erase(*set.begin()) + 1; } ans += dp[num - 2]; } cout << setprecision(9)<