n,p=gets.split n=n.to_i p=p.to_f seives=Array.new(n+1,1.0) seives[0]=seives[1]=0.0 2.upto(n){|i| q=seives[i] k=i+i while k<=n seives[k]*=(1-p) k+=i end } puts "%.9f"%seives.inject(:+)