import sequtils,strutils,strscans var N : int p : float s = stdin.readline A : array[1000002, float] ans : float discard scanf(s,"$i $f", N, p) for i in 2..N: A[i] = 1 for i in 2..N: ans += A[i] var j = i * 2 while j <= N: A[j] *= 1 - p j += i echo ans