package yukicoder; import java.util.Scanner; public class Q144 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); double p = sc.nextDouble(); double[] pro = new double[n + 1]; for (int i = 2; i <= n; ++i) { pro[i] = 1; } for (int i = 2; i <= n; ++i) { for (int j = 2 * i; j <= n; j += i) { pro[j] = pro[j] * (1 - p); } } double ans = 0; for (int i = 2; i <= n; ++i) { ans += pro[i]; } System.out.println(ans); } }