import java.util.Scanner; public class yuki144 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String[] strs = scanner.nextLine().split(" ", 0); int N = Integer.parseInt(strs[0]); double p = Double.parseDouble(strs[1]); double ans = 0.0; for(int i=2; i<=N; i++){ int j = 2; int dNum = 0; while(j*j<=i){ if(i%j==0){ dNum += j*j!=i ? 2 : 1; } j += 1; } ans += Math.pow(1-p, dNum); } System.out.println(ans); } }