fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let mut n: u64 = s.trim().parse().unwrap(); let (mut a, mut i) = (0, 2); while i <= n { if i * i > n { a += n; break; } if n % i == 0 { n /= i; a += i; } else { i += 1; } } println!("{a}") }