import bisect import os from collections import Counter, deque from fractions import gcd from functools import lru_cache from functools import reduce import functools import heapq import itertools import math import numpy as np import re import sys if os.getenv("LOCAL"): sys.stdin = open("_in.txt", "r") sys.setrecursionlimit(2147483647) INF = float("inf") IN = sys.stdin.readline().rstrip().split() N = int(IN[0]) P = float(IN[1]) # 列挙される期待値=(1-p)^約数の数 sieve = np.zeros(N + 1) for n in range(2, N + 1): m = n * 2 while m <= N: sieve[m] += 1 m += n e = (1 - P) ** sieve[2:] print(e.sum())