fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut dp = vec![vec![0.; 7]; n+1]; dp[1][1] = 1.; for i in 1..n { for j in 1..=6 { if dp[i][j] == 0. { continue; } dp[i+1][j] += dp[i][j] * j as f64 / 6.; if j+1 <= 6 { dp[i+1][j+1] += dp[i][j] * (6 - j) as f64 / 6.; } } } println!("{}", dp[n][6]); }