from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial import heapq import bisect from collections import deque,Counter,defaultdict from itertools import permutations,combinations from decimal import Decimal,ROUND_HALF_UP from functools import lru_cache import sys sys.setrecursionlimit(10**8) N, p = map(float, input().split()) N = int(N) #2は扱いにくいから先に足しておく ans = 1 for i in range(3, N+1): count = 0 for j in range(2, int(sqrt(i))+1): if i%j == 0: count += 1 #重複に注意 if i//j != j: count += 1 ans += (1-p)**count print(ans)