/** * @FileName a.cpp * @Author kanpurin * @Created 2021.04.22 15:38:29 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n; double p;cin >> n >> p; vector a(n+1); double ans = 0; for (int i = 2; i <= n; i++) { for (int j = i+i; j <= n; j+=i) { a[j]++; } ans += pow(1-p,a[i]); } printf("%.10f\n",ans); return 0; }