#!/usr/local/bin/ruby
class EratosthenesLikeSieve
  def initialize(*arg)
    @n,@k = arg
    @sigma = Array.new(@n+1,0)
    eratosthenes
  end

  private
  def eratosthenes
    (2..@n).each do |i|
      i.step(@n,i) do |j|
        @sigma[j]+=1
      end
    end
  end
  public

  def ans
    r = 0
    pb = 1-@k
    (2..@n).each do |i|
      r += 1*pb**(@sigma[i]-1)
    end
    r
  end
end
### END: class EratosthenesLikeSieve
       iod = STDIN
n,k = iod.gets.split
puts EratosthenesLikeSieve.new(n.to_i,k.to_f).ans
exit 0