#include #include using ld = long double; int main() { int N; ld P; std::cin >> N >> P; std::vector p(N + 1, 1); for (int i = 1; i <= N; i++) { p[i] = (1 - P) * p[i - 1]; } std::vector cnt(N + 1, 0); for (int i = 2; i <= N; i++) { for (int j = 2; i * j <= N; j++) { cnt[i * j]++; } } ld ans = 0; for (int i = 2; i <= N; i++) { ans += p[cnt[i]]; } std::cout << ans << std::endl; return 0; }