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: usize = itr.next().unwrap().parse().unwrap(); // gcd(n, n * (n - 1) / 2) let mut m = if n % 2 == 0 { n / 2 } else { n }; let mut i = 2; let mut ans = 1; while i * i <= m { let mut mul = i; while m % i == 0 { m /= i; mul *= i; } ans *= (mul - 1) / (i - 1); i += 1; } if m != 1 { ans *= 1 + m; } println!("{}", ans); }