n = gets.to_i x = n.gcd(n * (n - 1) / 2) puts x