import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); double p = sc.nextDouble(); int[] d = new int[N+10]; for(int i=2;i<=N;i++){ for(int j=i*2;j<=N;j+=i){ d[j]++; } } double e = 0; for(int i=2;i<=N;i++){ if(d[i]==0) e+=1; else e+=Math.pow(1-p,d[i]); } System.out.println(e); } }