use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: u128 = itr.next().unwrap().parse().unwrap(); let m: u128 = n * (n + 1) / 2; let mut ans = 0u128; let mut i = 1u128; while i * i <= n { if n % i == 0 { if m % i == 0 { ans += i; } if i != n / i && m % (n / i) == 0 { ans += n / i } } i += 1; } println!("{}", ans); }