use std::io::{self, Write}; use std::{fmt, ops, str}; macro_rules! read { ( $t:ty ) => {{ let mut input = String::new(); io::stdin().read_line(&mut input).unwrap(); input.trim_end().parse::<$t>().ok().unwrap() }}; ( $( $t:ty ),* ) => {{ let mut input = String::new(); io::stdin().read_line(&mut input).unwrap(); let mut iter = input.split_whitespace(); ( $( iter.next().unwrap().parse::<$t>().unwrap() ),* ) }}; } struct IoStr(Vec); impl str::FromStr for IoStr { type Err = (); fn from_str(s: &str) -> Result { Ok(IoStr(s.chars().collect())) } } impl fmt::Display for IoStr { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.0.iter().collect::()) } } #[derive(Clone)] struct IoVec(Vec); impl str::FromStr for IoVec { type Err = T::Err; fn from_str(s: &str) -> Result { let iter = s.split_whitespace(); Ok(IoVec(iter.map(|x| x.parse()).collect::>()?)) } } impl fmt::Display for IoVec { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.0.iter().map(|x| x.to_string()) .collect::>().join(" ") ) } } impl ops::Index for IoVec { type Output = T; fn index(&self, i: usize) -> &Self::Output { self.0.get(i - 1).unwrap() } } impl ops::IndexMut for IoVec { fn index_mut(&mut self, i: usize) -> &mut Self::Output { self.0.get_mut(i - 1).unwrap() } } fn solve(writer: &mut io::BufWriter) { let x = read!(i32); if x == 2 { writeln!(writer, "{}", 1_000_000).ok(); return; } let mut ans = 0.0; let mut v = vec![1_000_000.0; 500_000]; for i in 1..50 { for j in 2..500_000 { v[j] /= j as f64; if i < x { continue; } ans += v[j]; } } writeln!(writer, "{}", ans.floor() as i64).ok(); } fn main() { let stdout = io::stdout(); let mut writer = io::BufWriter::new(stdout.lock()); solve(&mut writer); }