#include using namespace std; typedef long long ll; typedef pair Pint; typedef pair P; //typedef pair> P; //typedef tuple T; ll INFL = 1000000000000000010;//10^18 = 2^60 int INF = 2147483600;//10^9 ll MOD = 1000000007; vector dy = {0,0,1,-1}; vector dx = {1,-1,0,0}; int divisor(ll n){ int res = 0; for(ll i = 1; i * i <= n; i++){ if(n % i == 0){ res++; if(i != n/i) res++; } } return res; } int main(void){ int N; double p; cin >> N >> p; double ans = 0.0; for(int i = 2; i <= N; i++){ int x = divisor(i); x -= 2; ans += pow((1.0-p), x); } cout << ans << endl; }