require 'prime' n,m=gets.split.map &:to_i k=m.prime_division.map{|x,p|r=0;r+=n/=x while n>0;r/p}.min r=Math.lgamma(n+1)[0]/Math.log(10)-k*Math.log10(m) x=(10**(r-r.to_i+3)).to_i puts '%d.%03de%d'%[x/1000,x%1000,r.to_i]