N,P=input().split() M=int(N)+1 l=[1.]*M for i in range(2,M): for j in range(i+i,M,i):l[j]*=1-float(P) print(sum(l)-2)