use std::io; use std::io::prelude::*; fn main() -> () { let stdin = io::read_to_string(io::stdin()).unwrap(); let mut stdin = stdin.split_ascii_whitespace(); let stdout = io::stdout(); let mut stdout = io::BufWriter::new(stdout.lock()); let n: usize = stdin.next().unwrap().parse::().unwrap(); let p: f64 = stdin.next().unwrap().parse::().unwrap(); let mut d = vec![0; n + 1]; for i in 2..=n { let mut j = 2 * i; while j <= n { d[j] += 1; j += i; } } let res = (|| { let mut e = 0.0; for i in 2..=n { e += (1.0 - p).powi(d[i]); } e })(); writeln!(stdout, "{}", res).unwrap_or(()); }