using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { const int MAX = 1000000; static int N; static double p; static int[] D = new int[MAX+1]; static void Main() { for (int i = 2; i <= MAX; i++) for (int j = i + i; j <= MAX; j += i) D[j]++; string[] S = Console.ReadLine().Split(' '); N = int.Parse(S[0]); p = double.Parse(S[1]); double ans = 0; for(int i = 2; i <= N; i++) { ans += P(i); } Console.WriteLine(ans); } static double P(int i) { return Math.Pow(1.0 - p, D[i]); } }