SS = gets.split N = SS[0].to_i P = 1 - SS[1].to_f sum = 0 A = Array.new(N + 1, 1) for n in 2..N do sum += A[n] m = n * 2 while m <= N do A[m] *= P m += n end end puts sum