fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let n: usize = s.trim().parse().unwrap(); let mut l = vec![true; n + 1]; let mut i = 2; while i * i <= n { let mut j = i; while i * j <= n { l[i * j] = false; j += 1; } i += 1; } println!("{}", (2..=n).filter(|&x| l[x]).sum::()); }