# -*- coding:utf-8 -*- if __name__ == "__main__": n,p = map(float,raw_input().split()) n = int(n) a = [0 for i in xrange(n+1)] for i in xrange(2,n+1): k = i * 2 while k <= n: a[k] += 1 k+=i ans = 0 for i in xrange(2,n+1): if a[i] == 0: ans += 1 else: ans += pow(1-p,a[i]) print ans