import std.stdio, std.conv, std.math, std.string, std.range, std.array, std.algorithm; double[] is_prime; void Eratosthenes(long lim, double q){ is_prime[] = 1.0; is_prime[0] = 0.0; is_prime[1] = 0.0; for(long p=2; p<=lim; p++) { for(long k=2*p; k<=lim; k+=p) is_prime[k] *= q; } } void main(){ auto buf = readln().strip().split(); immutable N = buf[0].to!int; immutable p = buf[1].to!double; is_prime.length = N + 5; Eratosthenes(N, 1-p); double ans = 0; foreach(immutable i; 2 .. N+1) { ans += is_prime[i]; } writefln("%.10f", ans); }