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