n=gets.to_i
p1=gets.to_f
if 200<=n then
	puts 1
else
	q1=1.0-p1
	puts (p1*(1-q1**n))/(1.0-q1)
end