package no144; import java.util.Arrays; 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(); double[] isPrime = new double[n+1]; Arrays.fill(isPrime, 1.0D); double ans = 0; for(int i=2;i<=n;i++) { ans += isPrime[i]; for(int j=i*2;j<=n;j+=i) { isPrime[j] *= (1-p); } } System.out.println(ans); } }