#include<iostream>
using namespace std;
int n;double p,ans;
main()
{
	cin>>n>>p;
	p=1-p;
	for(int i=2;i<=n;i++)
	{
		double now=1;
		for(int j=2;j<i;j++)
		{
			if(i%j==0)now*=p;
		}
		ans+=now;
	}
	cout<<ans<<endl;
}