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)^約数の数 E = np.ones(N + 1) for n in range(2, N // 2 + 1): E[np.arange(n * 2, N + 1, n)] *= 1 - P print(E[2:].sum())