import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final double p = sc.nextDouble(); double[] probably_prime = new double[N + 1]; Arrays.fill(probably_prime, 1.0); probably_prime[0] = probably_prime[1] = 0.0; for(int i = 2; i <= N; i++){ //System.out.println(Arrays.toString(probably_prime)); //System.out.printf("%d : %.10f\n", i, probably_prime[i]); for(int j = i + i; j <= N; j += i){ probably_prime[j] *= (1 - p); } } double sum = 0; for(int i = 2; i <= N; i++){ sum += probably_prime[i]; } System.out.printf("%.10f\n", sum); } }